diff options
| author | Salvatore Orlando <salvatore.orlando@eu.citrix.com> | 2011-06-27 14:42:36 +0100 |
|---|---|---|
| committer | Salvatore Orlando <salvatore.orlando@eu.citrix.com> | 2011-06-27 14:42:36 +0100 |
| commit | f4753fbcc0f84bf1f6e117e5f983ccffd3a5f93e (patch) | |
| tree | 457d12f19c743d17b76ea68089185ff967d613dc /bin | |
| parent | 044cbc632ead87762796f999d5c9dc41e899156b (diff) | |
| parent | 8a8c013cd4513b07e936125a23188e7608f40d58 (diff) | |
| download | nova-f4753fbcc0f84bf1f6e117e5f983ccffd3a5f93e.tar.gz nova-f4753fbcc0f84bf1f6e117e5f983ccffd3a5f93e.tar.xz nova-f4753fbcc0f84bf1f6e117e5f983ccffd3a5f93e.zip | |
Merge trunk
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-manage | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index 000e834f0..02f20347d 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -56,11 +56,11 @@ import gettext import glob import json +import netaddr import os import sys import time -import IPy # If ../nova/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... @@ -257,6 +257,11 @@ class RoleCommands(object): """adds role to user if project is specified, adds project specific role arguments: user, role [project]""" + if project: + projobj = self.manager.get_project(project) + if not projobj.has_member(user): + print "%s not a member of %s" % (user, project) + return self.manager.add_role(user, role, project) def has(self, user, role, project=None): @@ -513,7 +518,7 @@ class FloatingIpCommands(object): def create(self, host, range): """Creates floating ips for host by range arguments: host ip_range""" - for address in IPy.IP(range): + for address in netaddr.IPNetwork(range): db.floating_ip_create(context.get_admin_context(), {'address': str(address), 'host': host}) @@ -521,7 +526,7 @@ class FloatingIpCommands(object): def delete(self, ip_range): """Deletes floating ips by range arguments: range""" - for address in IPy.IP(ip_range): + for address in netaddr.IPNetwork(ip_range): db.floating_ip_destroy(context.get_admin_context(), str(address)) |
