diff --git a/dashboard/windc/workflows.py b/dashboard/windc/workflows.py index 9724aa8c..5ff7d9eb 100644 --- a/dashboard/windc/workflows.py +++ b/dashboard/windc/workflows.py @@ -157,7 +157,9 @@ class CreateWinService(workflows.Workflow): def handle(self, request, context): try: datacenter = context.get('domain_controller_name', '') - service = api.windc.services_create(request, context) + service = api.windc.services_create(request, + datacenter, + context) return True except: exceptions.handle(request) diff --git a/windc/heat_run b/windc/heat_run index 69e41829..e2498a84 100755 --- a/windc/heat_run +++ b/windc/heat_run @@ -1,5 +1,8 @@ #!/bin/bash -source openrc.sh + +#export OS_USERNAME=admin +#source ../../devstack/openrc +#nova keypair-add keero-linux-keys > heat_key.priv heat "$@" diff --git a/windc/windc/api/v1/services.py b/windc/windc/api/v1/services.py index 60409261..0a05593b 100644 --- a/windc/windc/api/v1/services.py +++ b/windc/windc/api/v1/services.py @@ -49,6 +49,7 @@ class Services_Controller(object): # We need to create Service object and return its id params['tenant_id'] = tenant_id params['datacenter_id'] = datacenter_id + params['type'] = 'active_directory_service' service_id = core_api.create_service(self.conf, params) return {'service': {'id': service_id}} diff --git a/windc/windc/core/builders/ActiveDirectory.py b/windc/windc/core/builders/ActiveDirectory.py index 703703b2..db0dcf17 100644 --- a/windc/windc/core/builders/ActiveDirectory.py +++ b/windc/windc/core/builders/ActiveDirectory.py @@ -18,6 +18,7 @@ import logging import uuid +import os LOG = logging.getLogger(__name__) from windc.core.builder import Builder @@ -46,8 +47,10 @@ class ActiveDirectory(Builder): def do_analysis(self, context, event, data): LOG.debug("Doing analysis for data: %s", data) - zones = data['zones'] - if data['type'] == self.type and len(zones) == 1: + print data + + context['zones'] = ['a1'] + if data['type'] == self.type: LOG.debug("It is a service which I should build.") datacenter_id = data['datacenter_id'] dc = db_api.datacenter_get(context['conf'],data['tenant_id'], @@ -90,6 +93,9 @@ class ActiveDirectory(Builder): def deploy_template_command(self, context, event, data): LOG.debug("Creating CloudFormation Template deployment command...") + print context['template'].to_json() + LOG.debug(context['template']) + print os.system('pwd') fname = "templates/"+str(uuid.uuid4()) f=open(fname, "w") f.write(context['template'].to_json()) @@ -111,4 +117,4 @@ class ActiveDirectory(Builder): def submit_commands(self, context, event, data): LOG.debug("Submit commands for execution...") - pass \ No newline at end of file + pass diff --git a/windc/windc/core/commands.py b/windc/windc/core/commands.py index 86473c16..f15105c8 100644 --- a/windc/windc/core/commands.py +++ b/windc/windc/core/commands.py @@ -26,16 +26,8 @@ class Command: type = "Empty" context = None - def __init__(self): - self.type = "Empty" - self.context = None - self.data = None - def __init__(self, type, context): - self.type = type - self.context = context - - def __init__(self, type, context, data): + def __init__(self, type="Empty", context=None, data=None): self.type = type self.context = context self.data = data diff --git a/windc/windc/drivers/openstack_heat.py b/windc/windc/drivers/openstack_heat.py index 7661bb68..6d584a76 100644 --- a/windc/windc/drivers/openstack_heat.py +++ b/windc/windc/drivers/openstack_heat.py @@ -32,7 +32,7 @@ class Heat: def execute(self, command): # client = Client('1',OS_IMAGE_ENDPOINT, OS_TENANT_ID) LOG.debug('Calling heat script to execute template') - call(["./heat_run","stack-create","-f "+command.context['template_name'], + call(["./heat_run","stack-create","-f"+command.context['template_name'], command.context['stack_name']]) pass