Fixed many small issues.
This commit is contained in:
@@ -157,7 +157,9 @@ class CreateWinService(workflows.Workflow):
|
|||||||
def handle(self, request, context):
|
def handle(self, request, context):
|
||||||
try:
|
try:
|
||||||
datacenter = context.get('domain_controller_name', '')
|
datacenter = context.get('domain_controller_name', '')
|
||||||
service = api.windc.services_create(request, context)
|
service = api.windc.services_create(request,
|
||||||
|
datacenter,
|
||||||
|
context)
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
exceptions.handle(request)
|
exceptions.handle(request)
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source openrc.sh
|
|
||||||
|
#export OS_USERNAME=admin
|
||||||
|
#source ../../devstack/openrc
|
||||||
|
#nova keypair-add keero-linux-keys > heat_key.priv
|
||||||
heat "$@"
|
heat "$@"
|
||||||
|
|
||||||
|
@@ -49,6 +49,7 @@ class Services_Controller(object):
|
|||||||
# We need to create Service object and return its id
|
# We need to create Service object and return its id
|
||||||
params['tenant_id'] = tenant_id
|
params['tenant_id'] = tenant_id
|
||||||
params['datacenter_id'] = datacenter_id
|
params['datacenter_id'] = datacenter_id
|
||||||
|
params['type'] = 'active_directory_service'
|
||||||
service_id = core_api.create_service(self.conf, params)
|
service_id = core_api.create_service(self.conf, params)
|
||||||
return {'service': {'id': service_id}}
|
return {'service': {'id': service_id}}
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import uuid
|
import uuid
|
||||||
|
import os
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
from windc.core.builder import Builder
|
from windc.core.builder import Builder
|
||||||
@@ -46,8 +47,10 @@ class ActiveDirectory(Builder):
|
|||||||
|
|
||||||
def do_analysis(self, context, event, data):
|
def do_analysis(self, context, event, data):
|
||||||
LOG.debug("Doing analysis for data: %s", data)
|
LOG.debug("Doing analysis for data: %s", data)
|
||||||
zones = data['zones']
|
print data
|
||||||
if data['type'] == self.type and len(zones) == 1:
|
|
||||||
|
context['zones'] = ['a1']
|
||||||
|
if data['type'] == self.type:
|
||||||
LOG.debug("It is a service which I should build.")
|
LOG.debug("It is a service which I should build.")
|
||||||
datacenter_id = data['datacenter_id']
|
datacenter_id = data['datacenter_id']
|
||||||
dc = db_api.datacenter_get(context['conf'],data['tenant_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):
|
def deploy_template_command(self, context, event, data):
|
||||||
LOG.debug("Creating CloudFormation Template deployment command...")
|
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())
|
fname = "templates/"+str(uuid.uuid4())
|
||||||
f=open(fname, "w")
|
f=open(fname, "w")
|
||||||
f.write(context['template'].to_json())
|
f.write(context['template'].to_json())
|
||||||
@@ -111,4 +117,4 @@ class ActiveDirectory(Builder):
|
|||||||
|
|
||||||
def submit_commands(self, context, event, data):
|
def submit_commands(self, context, event, data):
|
||||||
LOG.debug("Submit commands for execution...")
|
LOG.debug("Submit commands for execution...")
|
||||||
pass
|
pass
|
||||||
|
@@ -26,16 +26,8 @@ class Command:
|
|||||||
type = "Empty"
|
type = "Empty"
|
||||||
context = None
|
context = None
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.type = "Empty"
|
|
||||||
self.context = None
|
|
||||||
self.data = None
|
|
||||||
|
|
||||||
def __init__(self, type, context):
|
def __init__(self, type="Empty", context=None, data=None):
|
||||||
self.type = type
|
|
||||||
self.context = context
|
|
||||||
|
|
||||||
def __init__(self, type, context, data):
|
|
||||||
self.type = type
|
self.type = type
|
||||||
self.context = context
|
self.context = context
|
||||||
self.data = data
|
self.data = data
|
||||||
|
@@ -32,7 +32,7 @@ class Heat:
|
|||||||
def execute(self, command):
|
def execute(self, command):
|
||||||
# client = Client('1',OS_IMAGE_ENDPOINT, OS_TENANT_ID)
|
# client = Client('1',OS_IMAGE_ENDPOINT, OS_TENANT_ID)
|
||||||
LOG.debug('Calling heat script to execute template')
|
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']])
|
command.context['stack_name']])
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user