Merge lp:~vishvananda/nova/lp831995 into lp:~hudson-openstack/nova/trunk

Proposed by Vish Ishaya
Status: Merged
Approved by: Devin Carlen
Approved revision: 1481
Merged at revision: 1483
Proposed branch: lp:~vishvananda/nova/lp831995
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 45 lines (+12/-2)
2 files modified
nova/auth/manager.py (+11/-2)
nova/tests/test_auth.py (+1/-0)
To merge this branch: bzr merge lp:~vishvananda/nova/lp831995
Reviewer Review Type Date Requested Status
Devin Carlen (community) Approve
Brian Lamar (community) Approve
Review via email: mp+72618@code.launchpad.net

Description of the change

Adds a use_deprecated_auth flag to make sure creds generated using nova-manage commands will work with noauth.

To post a comment you must log in.
Revision history for this message
Brian Lamar (blamar) wrote :

This makes sense to me and works in my test environment when mixing/matching both APIs.

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (111.0 KiB)

The attempt to merge lp:~vishvananda/nova/lp831995 into lp:nova failed. Below is the output from the failed tests.

CreateserverextTest
    test_create_instance_with_duplicate_networks OK 0.20
    test_create_instance_with_duplicate_networks_xml OK 0.19
    test_create_instance_with_network_empty_fixed_ip OK 0.31
    test_create_instance_with_network_empty_fixed_ip_xml OK 0.18
    test_create_instance_with_network_invalid_id OK 0.18
    test_create_instance_with_network_invalid_id_xml OK 0.18
    test_create_instance_with_network_no_fixed_ip OK 0.20
    test_create_instance_with_network_no_fixed_ip_xml OK 0.36
    test_create_instance_with_network_no_id OK 0.18
    test_create_instance_with_network_no_id_xml OK 0.18
    test_create_instance_with_network_non_string_fixed_ip OK 0.18
    test_create_instance_with_no_networks OK 0.33
    test_create_instance_with_no_networks_xml OK 0.19
    test_create_instance_with_one_network OK 0.19
    test_create_instance_with_one_network_xml OK 0.20
    test_create_instance_with_two_networks OK 0.34
    test_create_instance_with_two_networks_xml OK 0.20
FloatingIpTest
    test_add_floating_ip_to_instance OK 0.19
    test_bad_address_param_in_add_floating_ip OK 0.20
    test_bad_address_param_in_remove_floating_ip OK 0.33
    test_floating_ip_allocate OK 0.20
    test_floating_ip_release OK 0.20
    test_floating_ip_show OK 0.20
    test_floating_ips_list OK 0.33
    test_missing_dict_param_in_add_floating_ip OK 0.20
    test_missing_dict_param_in_remove_floating_ip OK 0.20
    test_remove_floating_ip_from_instance OK 0.20
    test_translate_floating_ip_view OK 0.04
    test_translate_floating_ip_view_dict OK 0.02
KeypairsTest
    test_keypair_create OK 0.33
    test_keypair_delete OK 0.39
    test_keypair_import OK 0.23
    test_keypair_list OK 0.20
FixedIpTest
    test_add_fixed_ip OK 0.19
    test_add_fixed_ip_no_network OK 0.38
    test_remove_fixed_ip OK 0.18
    test_remove_fixed_ip_no_address OK 0.18
QuotaSetsTest
    test_format_quota_set OK 0.00
    test_quotas_defaults OK 0.19
    test_quotas_show_as_admin OK 0.33
    test_quotas_show_as_unauthorized_user OK 0.18
    test_quotas_u...

Revision history for this message
Vish Ishaya (vishvananda) wrote :

sigh, functional tests without unit tests. My bad. The flag is now set for the one test that needs it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/auth/manager.py'
2--- nova/auth/manager.py 2011-08-22 21:26:41 +0000
3+++ nova/auth/manager.py 2011-08-23 20:46:28 +0000
4@@ -41,10 +41,13 @@
5
6
7 FLAGS = flags.FLAGS
8+flags.DEFINE_bool('use_deprecated_auth',
9+ False,
10+ 'This flag must be set to use old style auth')
11+
12 flags.DEFINE_list('allowed_roles',
13 ['cloudadmin', 'itsec', 'sysadmin', 'netadmin', 'developer'],
14 'Allowed roles for project')
15-
16 # NOTE(vish): a user with one of these roles will be a superuser and
17 # have access to all api commands
18 flags.DEFINE_list('superuser_roles', ['cloudadmin'],
19@@ -814,7 +817,13 @@
20 s3_host = host
21 ec2_host = host
22 rc = open(FLAGS.credentials_template).read()
23- rc = rc % {'access': user.access,
24+ # NOTE(vish): Deprecated auth uses an access key, no auth uses a
25+ # the user_id in place of it.
26+ if FLAGS.use_deprecated_auth:
27+ access = user.access
28+ else:
29+ access = user.id
30+ rc = rc % {'access': access,
31 'project': pid,
32 'secret': user.secret,
33 'ec2': '%s://%s:%s%s' % (FLAGS.ec2_scheme,
34
35=== modified file 'nova/tests/test_auth.py'
36--- nova/tests/test_auth.py 2011-08-09 22:46:57 +0000
37+++ nova/tests/test_auth.py 2011-08-23 20:46:28 +0000
38@@ -147,6 +147,7 @@
39 '/services/Cloud'))
40
41 def test_can_get_credentials(self):
42+ self.flags(use_deprecated_auth=True)
43 st = {'access': 'access', 'secret': 'secret'}
44 with user_and_project_generator(self.manager, user_state=st) as (u, p):
45 credentials = self.manager.get_environment_rc(u, p)