Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
eea641f2
Commit
eea641f2
authored
Mar 06, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable tests
parent
268ca72f
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
27 deletions
+26
-27
message_example_provisioned.json
TOSCA/message_example_provisioned.json
+2
-3
drip-deployer.iml
deployer/.idea/drip-deployer.iml
+1
-1
misc.xml
deployer/.idea/misc.xml
+1
-1
test_deployer.py
deployer/test/test_deployer.py
+22
-22
No files found.
TOSCA/message_example_provisioned.json
View file @
eea641f2
This diff is collapsed.
Click to expand it.
deployer/.idea/drip-deployer.iml
View file @
eea641f2
...
...
@@ -4,7 +4,7 @@
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
8
(deployer)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
6
(deployer)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"PyDocumentationSettings"
>
...
...
deployer/.idea/misc.xml
View file @
eea641f2
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.
8
(deployer)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.
6
(deployer)"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
deployer/test/test_deployer.py
View file @
eea641f2
...
...
@@ -23,32 +23,32 @@ class TestDeployer(unittest.TestCase):
out
=
file
.
read
()
token
=
ansible_service
.
parse_dashboard_tokens
(
out
)
def
test
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
tosca_path
=
"../../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/message_example_provisioned.json'
if
not
os
.
path
.
exists
(
input_tosca_file_path
):
tosca_path
=
"../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/message_example_provisioned.json'
with
open
(
input_tosca_file_path
,
'r'
)
as
stream
:
parsed_json_message
=
json
.
load
(
stream
)
# parsed_json_message = json.loads(message)
owner
=
parsed_json_message
[
'owner'
]
tosca_file_name
=
'tosca_template'
tosca_template_json
=
parsed_json_message
[
'toscaTemplate'
]
interfaces
=
tosca
.
get_interfaces
(
tosca_template_json
)
tmp_path
=
tempfile
.
mkdtemp
()
vms
=
tosca
.
get_vms
(
tosca_template_json
)
inventory_path
=
ansible_service
.
write_inventory_file
(
tmp_path
,
vms
)
paths
=
ansible_service
.
write_playbooks_from_tosca_interface
(
interfaces
,
tmp_path
)
#
def test(self):
#
logger = logging.getLogger(__name__)
#
tosca_path = "../../TOSCA/"
#
input_tosca_file_path = tosca_path + '/message_example_provisioned.json'
#
if not os.path.exists(input_tosca_file_path):
#
tosca_path = "../TOSCA/"
#
input_tosca_file_path = tosca_path + '/message_example_provisioned.json'
#
#
with open(input_tosca_file_path, 'r') as stream:
#
parsed_json_message = json.load(stream)
#
#
#
parsed_json_message = json.loads(message)
#
owner = parsed_json_message['owner']
#
tosca_file_name = 'tosca_template'
#
tosca_template_json = parsed_json_message['toscaTemplate']
#
#
interfaces = tosca.get_interfaces(tosca_template_json)
#
tmp_path = tempfile.mkdtemp()
#
vms = tosca.get_vms(tosca_template_json)
#
inventory_path = ansible_service.write_inventory_file(tmp_path, vms)
#
paths = ansible_service.write_playbooks_from_tosca_interface(interfaces, tmp_path)
# for playbook_path in paths:
# out,err = ansible_service.run(inventory_path,playbook_path)
# api_key, join_token, discovery_token_ca_cert_hash = ansible_service.parse_tokens(out.decode("utf-8"))
ansible_playbook_path
=
k8s_service
.
write_ansible_k8s_files
(
tosca_template_json
,
tmp_path
)
#
ansible_playbook_path = k8s_service.write_ansible_k8s_files(tosca_template_json, tmp_path)
# out, err = ansible_service.run(inventory_path, ansible_playbook_path)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment