X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=sfa%2Fmethods%2FPerformOperationalAction.py;h=0d33b0c319e4d8aed75303806cb88efc4f0806bf;hp=1081b0e1797fd777eaf6b8a5a789fd6c3e59d788;hb=HEAD;hpb=04a3f20dc71bf8b3f96b1e3172623aa346a638a7 diff --git a/sfa/methods/PerformOperationalAction.py b/sfa/methods/PerformOperationalAction.py index 1081b0e1..0d33b0c3 100644 --- a/sfa/methods/PerformOperationalAction.py +++ b/sfa/methods/PerformOperationalAction.py @@ -2,17 +2,20 @@ from sfa.util.faults import SfaInvalidArgument, InvalidRSpec from sfa.util.xrn import urn_to_hrn from sfa.util.method import Method from sfa.util.sfatablesRuntime import run_sfatables +from sfa.util.sfalogging import logger + from sfa.trust.credential import Credential + from sfa.storage.parameter import Parameter, Mixed class PerformOperationalAction(Method): """ - Request that the named geni_allocated slivers be made - geni_provisioned, instantiating or otherwise realizing the - resources, such that they have a valid geni_operational_status - and may possibly be made geni_ready for experimenter use. This - operation is synchronous, but may start a longer process, such + Request that the named geni_allocated slivers be made + geni_provisioned, instantiating or otherwise realizing the + resources, such that they have a valid geni_operational_status + and may possibly be made geni_ready for experimenter use. This + operation is synchronous, but may start a longer process, such as creating and imaging a virtual machine @param slice urns ([string]) URNs of slivers to provision to @@ -20,7 +23,7 @@ class PerformOperationalAction(Method): @param options (dict) options """ - interfaces = ['aggregate', 'slicemgr'] + interfaces = ['aggregate'] accepts = [ Parameter(type([str]), "URNs"), Parameter(type([dict]), "Credentials"), @@ -30,18 +33,19 @@ class PerformOperationalAction(Method): returns = Parameter(dict, "Provisioned Resources") def call(self, xrns, creds, action, options): - self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s" % - (self.api.interface, xrns, self.name)) + logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s" % + (self.api.interface, xrns, self.name)) (speaking_for, _) = urn_to_hrn(options.get('geni_speaking_for')) # Find the valid credentials - valid_creds = self.api.auth.checkCredentialsSpeaksFor(creds, 'createsliver', xrns, - check_sliver_callback=self.api.driver.check_sliver_credentials, - options=options) + valid_creds = self.api.auth.checkCredentialsSpeaksFor( + creds, 'createsliver', xrns, + check_sliver_callback=self.api.driver.check_sliver_credentials, + options=options) origin_hrn = Credential(cred=valid_creds[0]).get_gid_caller().get_hrn() - self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" % - (self.api.interface, origin_hrn, xrns, self.name)) + logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" % + (self.api.interface, origin_hrn, xrns, self.name)) result = self.api.manager.PerformOperationalAction( self.api, xrns, creds, action, options) return result