diff options
author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-08-23 07:21:13 +0000 |
---|---|---|
committer | Tarmac <> | 2011-08-23 07:21:13 +0000 |
commit | de114ef5af2d7abaf84be0b71638b45e5de23393 (patch) | |
tree | 12044851929d82824f5fe0162b6eec14ad39e0ce /bin | |
parent | a69924e60848cf420aa76816aa9c41fd0a5d2995 (diff) | |
parent | 6f3610042452cc1cb6b1e0c204a127c0c48794f0 (diff) | |
download | nova-de114ef5af2d7abaf84be0b71638b45e5de23393.tar.gz |
This branch does the final tear out of AuthManager from the main code. The NoAuth middlewares (active by default) allow a user to specify any user and project id through headers (os_api) or access key (ec2_api).
The plan is to leave the auth manager code in but mention that it is deprecated. There is a sample paste config in ini to still allow old auth. Immediately after the diablo release we can tear out all of the Auth related code and not support the deprecated auth anymore.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/nova-manage | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index 1b29d71963..2e0bd0ecba 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -134,7 +134,7 @@ class VpnCommands(object): help='Project name') def list(self, project=None): """Print a listing of the VPN data for one or all projects.""" - + print "WARNING: This method only works with deprecated auth" print "%-12s\t" % 'project', print "%-20s\t" % 'ip:port', print "%-20s\t" % 'private_ip', @@ -170,17 +170,22 @@ class VpnCommands(object): def spawn(self): """Run all VPNs.""" + print "WARNING: This method only works with deprecated auth" for p in reversed(self.manager.get_projects()): if not self._vpn_for(p.id): print 'spawning %s' % p.id - self.pipe.launch_vpn_instance(p.id) + self.pipe.launch_vpn_instance(p.id, p.project_manager_id) time.sleep(10) @args('--project', dest="project_id", metavar='<Project name>', help='Project name') - def run(self, project_id): - """Start the VPN for a given project.""" - self.pipe.launch_vpn_instance(project_id) + @args('--user', dest="user_id", metavar='<user name>', help='User name') + def run(self, project_id, user_id): + """Start the VPN for a given project and user.""" + if not user_id: + print "WARNING: This method only works with deprecated auth" + user_id = self.manager.get_project(project_id).project_manager_id + self.pipe.launch_vpn_instance(project_id, user_id) @args('--project', dest="project_id", metavar='<Project name>', help='Project name') @@ -195,10 +200,6 @@ class VpnCommands(object): """ # TODO(tr3buchet): perhaps this shouldn't update all networks # associated with a project in the future - project = self.manager.get_project(project_id) - if not project: - print 'No project %s' % (project_id) - return admin_context = context.get_admin_context() networks = db.project_get_networks(admin_context, project_id) for network in networks: |