Merge "Rename manifests to make their names match 'full_service_name'."
This commit is contained in:
commit
465e1fe248
36
muranorepository/Services/activeDirectory-manifest.yaml
Normal file
36
muranorepository/Services/activeDirectory-manifest.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
agent:
|
||||||
|
- CreatePrimaryDC.template
|
||||||
|
- LeaveDomain.template
|
||||||
|
- SetPassword.template
|
||||||
|
- CreateSecondaryDC.template
|
||||||
|
- AskDnsIp.template
|
||||||
|
- JoinDomain.template
|
||||||
|
author: ''
|
||||||
|
description: <strong> The Active Directory Service </strong> includes one primary
|
||||||
|
and optionally a few secondary Domain Controllers, with DNS
|
||||||
|
enabled: true
|
||||||
|
full_service_name: activeDirectory
|
||||||
|
heat:
|
||||||
|
- RouterInterface.template
|
||||||
|
- Windows.template
|
||||||
|
- Network.template
|
||||||
|
- Param.template
|
||||||
|
- Subnet.template
|
||||||
|
- InstancePortWSubnet.template
|
||||||
|
- InstancePort.template
|
||||||
|
scripts:
|
||||||
|
- Install-RoleSecondaryDomainController.ps1
|
||||||
|
- Install-RolePrimaryDomainController.ps1
|
||||||
|
- Join-Domain.ps1
|
||||||
|
- ImportCoreFunctions.ps1
|
||||||
|
- Get-DnsListeningIpAddress.ps1
|
||||||
|
- Set-LocalUserPassword.ps1
|
||||||
|
service_display_name: Active Directory
|
||||||
|
service_version: ''
|
||||||
|
ui:
|
||||||
|
- ActiveDirectory.yaml
|
||||||
|
version: '0.1'
|
||||||
|
workflows:
|
||||||
|
- AD.xml
|
||||||
|
- Networking.xml
|
||||||
|
- Common.xml
|
@ -1,46 +0,0 @@
|
|||||||
version: 0.1
|
|
||||||
service_display_name: Active Directory
|
|
||||||
|
|
||||||
description: >-
|
|
||||||
<strong> The Active Directory Service </strong>
|
|
||||||
includes one primary and optionally a few secondary
|
|
||||||
Domain Controllers, with DNS
|
|
||||||
|
|
||||||
full_service_name: activeDirectory
|
|
||||||
author: Mirantis Inc.
|
|
||||||
service_version: 1.0
|
|
||||||
enabled: True
|
|
||||||
|
|
||||||
ui:
|
|
||||||
- ActiveDirectory.yaml
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
- AD.xml
|
|
||||||
- Networking.xml
|
|
||||||
- Common.xml
|
|
||||||
|
|
||||||
heat:
|
|
||||||
- Windows.template
|
|
||||||
- InstancePort.template
|
|
||||||
- InstancePortWSubnet.template
|
|
||||||
- Network.template
|
|
||||||
- Param.template
|
|
||||||
- RouterInterface.template
|
|
||||||
- Subnet.template
|
|
||||||
|
|
||||||
agent:
|
|
||||||
- SetPassword.template
|
|
||||||
- CreatePrimaryDC.template
|
|
||||||
- AskDnsIp.template
|
|
||||||
- LeaveDomain.template
|
|
||||||
- JoinDomain.template
|
|
||||||
- CreateSecondaryDC.template
|
|
||||||
|
|
||||||
scripts:
|
|
||||||
- ImportCoreFunctions.ps1
|
|
||||||
- Set-LocalUserPassword.ps1
|
|
||||||
- Get-DnsListeningIpAddress.ps1
|
|
||||||
- Get-DnsListeningIpAddress.ps1
|
|
||||||
- Join-Domain.ps1
|
|
||||||
- Install-RolePrimaryDomainController.ps1
|
|
||||||
- Install-RoleSecondaryDomainController.ps1
|
|
@ -1,32 +0,0 @@
|
|||||||
version: 0.1
|
|
||||||
service_display_name: Demo Service
|
|
||||||
|
|
||||||
description: >-
|
|
||||||
<strong> Demo Service </strong>
|
|
||||||
shows how Murano is working.
|
|
||||||
|
|
||||||
full_service_name: demoService
|
|
||||||
author: Mirantis Inc.
|
|
||||||
service_version: 1.0
|
|
||||||
enabled: True
|
|
||||||
|
|
||||||
ui:
|
|
||||||
- Demo.yaml
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
- Demo.xml
|
|
||||||
- Common.xml
|
|
||||||
- Networking.xml
|
|
||||||
|
|
||||||
heat:
|
|
||||||
- Demo.template
|
|
||||||
- InstancePort.template
|
|
||||||
- InstancePortWSubnet.template
|
|
||||||
- Network.template
|
|
||||||
- Param.template
|
|
||||||
- RouterInterface.template
|
|
||||||
- Subnet.template
|
|
||||||
|
|
||||||
|
|
||||||
agent:
|
|
||||||
- Demo.template
|
|
24
muranorepository/Services/demoService-manifest.yaml
Normal file
24
muranorepository/Services/demoService-manifest.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
agent:
|
||||||
|
- Demo.template
|
||||||
|
author: ''
|
||||||
|
description: <strong> Demo Service </strong> shows how Murano is working.
|
||||||
|
enabled: true
|
||||||
|
full_service_name: demoService
|
||||||
|
heat:
|
||||||
|
- Demo.template
|
||||||
|
- RouterInterface.template
|
||||||
|
- Network.template
|
||||||
|
- Param.template
|
||||||
|
- Subnet.template
|
||||||
|
- InstancePortWSubnet.template
|
||||||
|
- InstancePort.template
|
||||||
|
scripts: []
|
||||||
|
service_display_name: Demo Service 11
|
||||||
|
service_version: ''
|
||||||
|
ui:
|
||||||
|
- Demo.yaml
|
||||||
|
version: '0.1'
|
||||||
|
workflows:
|
||||||
|
- Networking.xml
|
||||||
|
- Common.xml
|
||||||
|
- Demo.xml
|
@ -165,7 +165,7 @@ def perform_deletion(files_for_deletion, manifest_for_deletion):
|
|||||||
backup_dir = backup_data()
|
backup_dir = backup_data()
|
||||||
service_name = manifest_for_deletion.full_service_name
|
service_name = manifest_for_deletion.full_service_name
|
||||||
path_to_manifest = os.path.join(CONF.manifests,
|
path_to_manifest = os.path.join(CONF.manifests,
|
||||||
manifest_for_deletion.manifest_file_name)
|
'{0}-manifest.yaml'.format(service_name))
|
||||||
try:
|
try:
|
||||||
if os.path.exists(path_to_manifest):
|
if os.path.exists(path_to_manifest):
|
||||||
log.debug('Deleting manifest file {0}'.format(path_to_manifest))
|
log.debug('Deleting manifest file {0}'.format(path_to_manifest))
|
||||||
|
@ -223,6 +223,13 @@ def create_service(service_name):
|
|||||||
service_data = json.loads(request.data)
|
service_data = json.loads(request.data)
|
||||||
except:
|
except:
|
||||||
return make_response('Unable to load json data', 500)
|
return make_response('Unable to load json data', 500)
|
||||||
|
|
||||||
|
service_id = service_data.get('full_service_name')
|
||||||
|
if not service_id or service_id != service_name:
|
||||||
|
return make_response(
|
||||||
|
"Body attribute 'full_service_name' value is {0} which doesn't "
|
||||||
|
"correspond to 'service_name' part of URL (equals to {1})".format(
|
||||||
|
service_id, service_name), 400)
|
||||||
resp = api.create_service(service_name, service_data)
|
resp = api.create_service(service_name, service_data)
|
||||||
api.reset_cache()
|
api.reset_cache()
|
||||||
return resp
|
return resp
|
||||||
|
@ -52,8 +52,16 @@ class ManifestParser(object):
|
|||||||
self.manifest_directory = manifest_directory
|
self.manifest_directory = manifest_directory
|
||||||
|
|
||||||
def _validate_manifest(self, file, service_manifest_data):
|
def _validate_manifest(self, file, service_manifest_data):
|
||||||
for key, value in service_manifest_data.iteritems():
|
service_id = service_manifest_data.get('full_service_name')
|
||||||
|
if not service_id or '{0}-manifest.yaml'.format(service_id) != file:
|
||||||
|
log.error("Attribute 'full_service_name' inside manifest '{0}' "
|
||||||
|
"has value '{1}' which doesn't correspond to its "
|
||||||
|
"filename, skipping this manifest completely."
|
||||||
|
"".format(file, service_id))
|
||||||
|
return False, False
|
||||||
|
|
||||||
valid_file_info = True
|
valid_file_info = True
|
||||||
|
for key, value in service_manifest_data.iteritems():
|
||||||
if key in DATA_TYPES:
|
if key in DATA_TYPES:
|
||||||
if key != MANIFEST:
|
if key != MANIFEST:
|
||||||
root_directory = os.path.join(self.manifest_directory,
|
root_directory = os.path.join(self.manifest_directory,
|
||||||
@ -78,7 +86,7 @@ class ManifestParser(object):
|
|||||||
"doesn't exist at {2}".format(filename,
|
"doesn't exist at {2}".format(filename,
|
||||||
file,
|
file,
|
||||||
absolute_path))
|
absolute_path))
|
||||||
return valid_file_info
|
return valid_file_info, True
|
||||||
|
|
||||||
def parse(self):
|
def parse(self):
|
||||||
manifests = []
|
manifests = []
|
||||||
@ -99,23 +107,18 @@ class ManifestParser(object):
|
|||||||
"The reason: {1!s}".format(manifest_file,
|
"The reason: {1!s}".format(manifest_file,
|
||||||
exc))
|
exc))
|
||||||
continue
|
continue
|
||||||
manifest_data['manifest_file_name'] = file
|
|
||||||
manifest_is_valid = self._validate_manifest(file,
|
|
||||||
manifest_data)
|
|
||||||
manifest_data["valid"] = manifest_is_valid
|
|
||||||
|
|
||||||
|
manifest_is_valid, use_manifest = self._validate_manifest(
|
||||||
|
file, manifest_data)
|
||||||
|
if use_manifest:
|
||||||
|
manifest_data["valid"] = manifest_is_valid
|
||||||
manifests.append(Manifest(manifest_data))
|
manifests.append(Manifest(manifest_data))
|
||||||
|
|
||||||
return manifests
|
return manifests
|
||||||
|
|
||||||
def _get_manifest_path(self, service_name):
|
def _get_manifest_path(self, service_name):
|
||||||
# ToDO: Rename manifests to it's id and remove this func
|
return os.path.join(self.manifest_directory,
|
||||||
manifests = self.parse()
|
'{0}-manifest.yaml'.format(service_name))
|
||||||
for manifest in manifests:
|
|
||||||
if manifest.full_service_name == service_name:
|
|
||||||
path_to_manifest = os.path.join(self.manifest_directory,
|
|
||||||
manifest.manifest_file_name)
|
|
||||||
return path_to_manifest
|
|
||||||
return None
|
|
||||||
|
|
||||||
def toggle_enabled(self, service_name):
|
def toggle_enabled(self, service_name):
|
||||||
path_to_manifest = self._get_manifest_path(service_name)
|
path_to_manifest = self._get_manifest_path(service_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user