summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Alekseyev <ilyaalekseyev@acm.org>2011-07-14 22:34:49 +0400
committerIlya Alekseyev <ilyaalekseyev@acm.org>2011-07-14 22:34:49 +0400
commit40a9488b4b96fa809bd18f4a06018186a488507a (patch)
treedf6817121032512ddbdb8138702eb91f572254dc
parent76fbcb9bfd88a56c5a3419bf227cca28334f6844 (diff)
added commands
-rwxr-xr-xbin/nova-manage21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 7dfe91698..5a934b613 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -518,6 +518,27 @@ class FixedIpCommands(object):
fixed_ip['address'],
mac_address, hostname, host)
+ def reserve(self, address):
+ """Mark fixed ip as reserved
+ arguments: address"""
+ self._set_reserved(address, True)
+
+ def waste(self, address):
+ """Mark fixed ip as free to use
+ arguments: address"""
+ self._set_reserved(address, False)
+
+ def _set_reserved(self, address, reserved):
+ ctxt = context.get_admin_context()
+
+ try:
+ fixed_ip = db.fixed_ip_get_by_address(ctxt, address)
+ db.fixed_ip_update(ctxt, fixed_ip['address'],
+ {'reserved': reserved})
+ except exception.NotFound as ex:
+ print "error: %s" % ex
+ sys.exit(2)
+
class FloatingIpCommands(object):
"""Class for managing floating ip."""