From dd1e99c04aa72f4fae7cc3fa845be9fb2dc64258 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Mon, 12 Feb 2007 19:59:00 +0000 Subject: [PATCH] Replace enableSliceCreation/removeSliceCreation with a single setSliceMax function. --- plc.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/plc.py b/plc.py index 80a7779..c4444f0 100644 --- a/plc.py +++ b/plc.py @@ -5,7 +5,7 @@ # Faiyaz Ahmed # Copyright (C) 2006, 2007 The Trustees of Princeton University # -# $Id: plc.py,v 1.8 2007/02/12 19:15:08 mef Exp $ +# $Id: plc.py,v 1.9 2007/02/12 19:54:56 mef Exp $ # from emailTxt import * @@ -226,7 +226,8 @@ def enableSlices(argv): if slice_attribute['name'] == "plc_slice_state": api.DeleteSliceAttribute(auth, slice_attribute['slice_attribute_id']) -def _SetSliceMax(argv): +def setSliceMax(argv): + """Set max_slices for Slice. Returns previous max_slices""" global api, auth if auth is None: printUsage("requires admin privs") @@ -256,15 +257,6 @@ def _SetSliceMax(argv): except Exception, exc: logger.info("_SetSliceMax: %s" % exc) -def removeSliceCreation(argv): - """Removes ability to create slices. Returns previous max_slices""" - argv.append(0) - _SetSliceMax(argv) - -def enableSliceCreation(argv): - """QED""" - _SetSliceMax(argv) - USAGE = """ Usage: %s [-u user] [-p password] [-r role] CMD @@ -346,8 +338,7 @@ funclist = (("nodesDbg",nodesDbg), ("nodePOD", nodePOD), ("freezeSlices", suspendSlices), ("unfreezeSlices", enableSlices), - ("disableSliceCreation",removeSliceCreation), - ("enableSliceCreation", enableSliceCreation), + ("setSliceMax", setSliceMax), ("renewAllSlices", renewAllSlices)) functbl = {} -- 2.45.2