return slices
# get data from db
- projs = self.shell.auth_manager.get_projects()
- slice_urns = [OSXrn(proj.name, 'slice').urn for proj in projs]
-
+ instance_urns = []
+ instances = self.shell.nova_manager.servers.findall()
+ for instance in instances:
+ if instance.name not in instance_urns:
+ instance_urns.append(OSXrn(instance.name, type='slice').urn)
+
# cache the result
if self.cache:
logger.debug ("OpenStackDriver.list_slices stores value in cache")
- self.cache.add('slices', slice_urns)
+ self.cache.add('slices', instance_urns)
- return slice_urns
+ return instance_urns
# first 2 args are None in case of resource discovery
def list_resources (self, slice_urn, slice_hrn, creds, options):
if instances:
top_level_status = 'ready'
result['geni_urn'] = slice_urn
- result['plos_login'] = 'root'
+ result['plos_login'] = 'root'
+ # do we need real dates here?
result['plos_expires'] = None
+ result['geni_expires'] = None
resources = []
for instance in instances:
res = {}
# instances are accessed by ip, not hostname. We need to report the ip
# somewhere so users know where to ssh to.
+ res['geni_expires'] = None
res['plos_hostname'] = instance.hostname
res['plos_created_at'] = datetime_to_string(utcparse(instance.created_at))
res['plos_boot_state'] = instance.vm_state
res['geni_urn'] = sliver_id
if instance.vm_state == 'running':
- res['boot_state'] = 'ready';
+ res['boot_state'] = 'ready'
+ res['geni_status'] = 'ready'
else:
res['boot_state'] = 'unknown'
+ res['geni_status'] = 'unknown'
resources.append(res)
result['geni_status'] = top_level_status