~yolanda.robla/nova/precise-security

« back to all changes in this revision

Viewing changes to bin/nova-manage

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-04-02 11:17:33 UTC
  • mto: (79.1.1 precise-proposed)
  • mto: This revision was merged to the branch mainline in revision 73.
  • Revision ID: package-import@ubuntu.com-20120402111733-jc0lg7anbrok67q7
Tags: upstream-2012.1~rc2
ImportĀ upstreamĀ versionĀ 2012.1~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
680
680
            instance_id = None
681
681
            if floating_ip['fixed_ip_id']:
682
682
                fixed_ip = db.fixed_ip_get(ctxt, floating_ip['fixed_ip_id'])
683
 
                instance = db.instance_get(ctxt, fixed_ip['instance_id'])
684
 
                instance_id = instance.get('uuid', "none")
 
683
                try:
 
684
                    instance = db.instance_get(ctxt, fixed_ip['instance_id'])
 
685
                    instance_id = instance.get('uuid', "none")
 
686
                except exception.InstanceNotFound:
 
687
                    msg = _('Missing instance %s')
 
688
                    instance_id = msg % fixed_ip['instance_id']
 
689
 
685
690
            print "%s\t%s\t%s\t%s\t%s" % (floating_ip['project_id'],
686
691
                                          floating_ip['address'],
687
692
                                          instance_id,
1455
1460
            if value is not None:
1456
1461
                print '%s = %s' % (key, value)
1457
1462
 
1458
 
    @args('--infile', dest='file_path', metavar='<path>',
 
1463
    @args('--infile', dest='infile', metavar='<path>',
1459
1464
          help='old-style flagfile to convert to config')
1460
 
    @args('--outfile', dest='file_path', metavar='<path>',
 
1465
    @args('--outfile', dest='outfile', metavar='<path>',
1461
1466
          help='path for output file. Writes config'
1462
1467
               'to stdout if not specified.')
1463
1468
    def convert(self, infile, outfile=None):
1542
1547
        am = manager.AuthManager()
1543
1548
 
1544
1549
        for user in am.get_users():
 
1550
            # NOTE(vish): Deprecated auth uses an access key, no auth uses a
 
1551
            #             the user_id in place of it.
 
1552
            if FLAGS.auth_strategy == 'deprecated':
 
1553
                access = user.access
 
1554
            else:
 
1555
                access = user.id
 
1556
 
1545
1557
            user_dict = {
1546
1558
                'id': user.id,
1547
1559
                'name': user.name,
1548
 
                'password': user.access,
 
1560
                'password': access,
1549
1561
            }
1550
1562
            output['users'].append(user_dict)
1551
1563
 
1552
1564
            ec2_cred = {
1553
1565
                'user_id': user.id,
1554
 
                'access_key': user.access,
 
1566
                'access_key': access,
1555
1567
                'secret_key': user.secret,
1556
1568
            }
1557
1569
            output['ec2_credentials'].append(ec2_cred)