Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Data center info to config file #issue81 #112

Merged
merged 3 commits into from
Jun 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jumpgate/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
cfg.StrOpt('default_ram', default=512000),
cfg.StrOpt('default_security_group_rules', default=20),
cfg.StrOpt('default_security_groups', default=10),
cfg.StrOpt('default_availability_zone', default=None),
],
'image': [
cfg.StrOpt('driver', default='jumpgate.image.drivers.sl'),
Expand Down
7 changes: 4 additions & 3 deletions jumpgate/compute/drivers/sl/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ def on_post(self, req, resp, tenant_id):
if lookup(body, 'server', 'personality'):
user_data['personality'] = lookup(body, 'server', 'personality')

datacenter = None
if lookup(body, 'server', 'availability_zone'):
datacenter = lookup(body, 'server', 'availability_zone')
datacenter = (lookup(body, 'server', 'availability_zone')
or CONF['compute']['default_availability_zone'])
if not datacenter:
return bad_request(resp, 'availability_zone missing')

cci = CCIManager(client)

Expand Down