コード例 #1
0
ファイル: omf-osmgr.py プロジェクト: thetoolsmith/omf
    def _process_nova_show(obj):
      if type(obj) != 'dict':
        d = {}
        for o in obj:
          d[o.human_id] = o.id
        omfbase.print_pretty_dict(d)
      else:
        for o in obj:
          os_client.log_and_print_info('name={0} id={1}'.format(o.human_id,o.id))

      sys.exit(0)
コード例 #2
0
ファイル: omf-osmgr.py プロジェクト: thetoolsmith/omf
    def _process_cinder_show(obj):
      for o in obj:
        os_client.log_and_print_info('name={0} id={1}'.format(o.name,o.id))
      sys.exit(0)

    nova_session = __novaclient()

    if (_args['show'] == 'networksfull'):

      _setup_client(client='neutron')

      neutron_session = __neutronclient()
      os_client.log_and_print_info('\nAvailable Networks (using neutron):')
      for net in neutron_session.get_networks():
        print '\n'
        omfbase.print_pretty_dict(net)

    if (_args['show'] == 'stacks'):
     
      #TODO: need to add filter on name
      _setup_client(client='heat')

      heat_session = __heatclient()

      count, stacks_obj, stacks_list  = heat_session.get_stacks()
       
      # THIS IS JUST SHOWING THE OPTIONAL WAYS TO ENUM EACH RETURNED OBJECT
      if (count):
        os_client.log_and_print_info('\nAvailable Stacks:')
        print '\nEnumerating the generator object....'
        try: