git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc1b763
)
-m workaround for instance public ip bug
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 16 Aug 2012 13:45:33 +0000
(09:45 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 16 Aug 2012 13:45:33 +0000
(09:45 -0400)
sfa/openstack/osaggregate.py
patch
|
blob
|
history
diff --git
a/sfa/openstack/osaggregate.py
b/sfa/openstack/osaggregate.py
index
73e0f61
..
78b0585
100644
(file)
--- a/
sfa/openstack/osaggregate.py
+++ b/
sfa/openstack/osaggregate.py
@@
-120,8
+120,19
@@
class OSAggregate:
sliver['disk_image'] = [disk_image]
# build interfaces
sliver['disk_image'] = [disk_image]
# build interfaces
- interfaces = []
+ rspec_node['services'] = []
+ rspec_node['interfaces'] = []
addresses = instance.addresses
addresses = instance.addresses
+ # HACK: public ips are stored in the list of private, but
+ # this seems wrong. Assume pub ip is the last in the list of
+ # private ips until openstack bug is fixed.
+ if addresses.get('private'):
+ login = Login({'authentication': 'ssh-keys',
+ 'hostname': addresses.get('private')[-1]['addr'],
+ 'port':'22', 'username': 'root'})
+ service = Services({'login': login})
+ rspec_node['services'].append(service)
+
for private_ip in addresses.get('private', []):
if_xrn = PlXrn(auth=self.driver.hrn,
interface='node%s:eth0' % (instance.hostId))
for private_ip in addresses.get('private', []):
if_xrn = PlXrn(auth=self.driver.hrn,
interface='node%s:eth0' % (instance.hostId))
@@
-129,11
+140,9
@@
class OSAggregate:
interface['ips'] = [{'address': private_ip['addr'],
#'netmask': private_ip['network'],
'type': private_ip['version']}]
interface['ips'] = [{'address': private_ip['addr'],
#'netmask': private_ip['network'],
'type': private_ip['version']}]
- interfaces.append(interface)
- rspec_node['interfaces'] = interfaces
+ rspec_node['interfaces'].append(interface)
# slivers always provide the ssh service
# slivers always provide the ssh service
- rspec_node['services'] = []
for public_ip in addresses.get('public', []):
login = Login({'authentication': 'ssh-keys',
'hostname': public_ip['addr'],
for public_ip in addresses.get('public', []):
login = Login({'authentication': 'ssh-keys',
'hostname': public_ip['addr'],