git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fad16c7
)
2to3 -f raise
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Thu, 31 Mar 2016 06:57:04 +0000
(08:57 +0200)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Thu, 31 Mar 2016 06:57:04 +0000
(08:57 +0200)
21 files changed:
clientbin/setRecord.py
patch
|
blob
|
history
sfa/client/sfaclientlib.py
patch
|
blob
|
history
sfa/dummy/dummyshell.py
patch
|
blob
|
history
sfa/federica/fdshell.py
patch
|
blob
|
history
sfa/managers/managerwrapper.py
patch
|
blob
|
history
sfa/managers/registry_manager.py
patch
|
blob
|
history
sfa/nitos/nitosdriver.py
patch
|
blob
|
history
sfa/nitos/nitosshell.py
patch
|
blob
|
history
sfa/planetlab/plshell.py
patch
|
blob
|
history
sfa/rspecs/elements/versions/ofeliav1Port.py
patch
|
blob
|
history
sfa/rspecs/versions/ofeliav1.py
patch
|
blob
|
history
sfa/server/xmlrpcapi.py
patch
|
blob
|
history
sfa/storage/alchemy.py
patch
|
blob
|
history
sfa/storage/parameter.py
patch
|
blob
|
history
sfa/storage/record.py
patch
|
blob
|
history
sfa/trust/certificate.py
patch
|
blob
|
history
sfa/util/method.py
patch
|
blob
|
history
sfa/util/storage.py
patch
|
blob
|
history
sfa/util/xrn.py
patch
|
blob
|
history
sfatables/commands/moo.py
patch
|
blob
|
history
wsdl/sfa2wsdl.py
patch
|
blob
|
history
diff --git
a/clientbin/setRecord.py
b/clientbin/setRecord.py
index
405c90d
..
bd77606
100755
(executable)
--- a/
clientbin/setRecord.py
+++ b/
clientbin/setRecord.py
@@
-47,9
+47,9
@@
def editDict(args, recordDict, options):
if vect in recordDict:
del recordDict[vect]
else:
if vect in recordDict:
del recordDict[vect]
else:
- raise TypeError
,
"Argument error: Records are updated with \n" \
+ raise TypeError
(
"Argument error: Records are updated with \n" \
"key=val1,val2,valN or\n" \
"key=val1,val2,valN or\n" \
- "key+=val1,val2,valN \n%s Unknown key/val" % vect
+ "key+=val1,val2,valN \n%s Unknown key/val" % vect
)
def replaceDict(newval, recordDict, options):
def replaceDict(newval, recordDict, options):
diff --git
a/sfa/client/sfaclientlib.py
b/sfa/client/sfaclientlib.py
index
ccdf36a
..
7736e52
100644
(file)
--- a/
sfa/client/sfaclientlib.py
+++ b/
sfa/client/sfaclientlib.py
@@
-200,7
+200,7
@@
class SfaClientBootstrap:
records = registry_proxy.Resolve (hrn, credential_string)
records=[record for record in records if record['type']==type]
if not records:
records = registry_proxy.Resolve (hrn, credential_string)
records=[record for record in records if record['type']==type]
if not records:
- raise RecordNotFound
, "hrn %s (%s) unknown to registry %s"%(hrn,type,self.registry_url
)
+ raise RecordNotFound
("hrn %s (%s) unknown to registry %s"%(hrn,type,self.registry_url)
)
record=records[0]
self.plain_write (output, record['gid'])
self.logger.debug("SfaClientBootstrap: Wrote GID for %s (%s) in %s"% (hrn,type,output))
record=records[0]
self.plain_write (output, record['gid'])
self.logger.debug("SfaClientBootstrap: Wrote GID for %s (%s) in %s"% (hrn,type,output))
@@
-316,7
+316,7
@@
class SfaClientBootstrap:
def assert_filename (self, filename, kind):
if not os.path.isfile (filename):
def assert_filename (self, filename, kind):
if not os.path.isfile (filename):
- raise IOError
,"Missing %s file %s"%(kind,filename
)
+ raise IOError
("Missing %s file %s"%(kind,filename)
)
return True
def assert_private_key (self):
return True
def assert_private_key (self):
@@
-354,7
+354,7
@@
class SfaClientBootstrap:
message="Could not produce/retrieve %s (%s -- %s)"%\
(filename,error[0],error[1])
self.logger.log_exc(message)
message="Could not produce/retrieve %s (%s -- %s)"%\
(filename,error[0],error[1])
self.logger.log_exc(message)
- raise Exception
, message
+ raise Exception
(message)
return wrapped
return wrap
return wrapped
return wrap
diff --git
a/sfa/dummy/dummyshell.py
b/sfa/dummy/dummyshell.py
index
c6cc833
..
50e78ac
100644
(file)
--- a/
sfa/dummy/dummyshell.py
+++ b/
sfa/dummy/dummyshell.py
@@
-26,7
+26,7
@@
class DummyShell:
def __getattr__(self, name):
def func(*args, **kwds):
if not name in DummyShell.direct_calls:
def __getattr__(self, name):
def func(*args, **kwds):
if not name in DummyShell.direct_calls:
- raise Exception
, "Illegal method call %s for DUMMY driver"%(name
)
+ raise Exception
("Illegal method call %s for DUMMY driver"%(name)
)
result=getattr(self.proxy, name)(*args, **kwds)
logger.debug('DummyShell %s returned ... '%(name))
return result
result=getattr(self.proxy, name)(*args, **kwds)
logger.debug('DummyShell %s returned ... '%(name))
return result
diff --git
a/sfa/federica/fdshell.py
b/sfa/federica/fdshell.py
index
42ec030
..
aefbdd1
100644
(file)
--- a/
sfa/federica/fdshell.py
+++ b/
sfa/federica/fdshell.py
@@
-30,7
+30,7
@@
class FdShell:
def __getattr__(self, name):
def func(*args, **kwds):
if name not in FdShell.direct_calls:
def __getattr__(self, name):
def func(*args, **kwds):
if name not in FdShell.direct_calls:
- raise Exception
, "Illegal method call %s for FEDERICA driver"%(name
)
+ raise Exception
("Illegal method call %s for FEDERICA driver"%(name)
)
logger.info("Issuing %s args=%s kwds=%s to federica"%\
(name,args,kwds))
# result=getattr(self.proxy, "AggregateManager.%s"%name)(credential, *args, **kwds)
logger.info("Issuing %s args=%s kwds=%s to federica"%\
(name,args,kwds))
# result=getattr(self.proxy, "AggregateManager.%s"%name)(credential, *args, **kwds)
diff --git
a/sfa/managers/managerwrapper.py
b/sfa/managers/managerwrapper.py
index
946f7d2
..
da8c98f
100644
(file)
--- a/
sfa/managers/managerwrapper.py
+++ b/
sfa/managers/managerwrapper.py
@@
-27,7
+27,7
@@
class ManagerWrapper:
# that's what happens when there's something wrong with the db
# or any bad stuff of that kind at startup time
logger.log_exc("Failed to create a manager, startup sequence is broken")
# that's what happens when there's something wrong with the db
# or any bad stuff of that kind at startup time
logger.log_exc("Failed to create a manager, startup sequence is broken")
- raise SfaAPIError
,"Argument to ManagerWrapper must be a module or class"
+ raise SfaAPIError
("Argument to ManagerWrapper must be a module or class")
self.interface = interface
def __getattr__(self, method):
self.interface = interface
def __getattr__(self, method):
diff --git
a/sfa/managers/registry_manager.py
b/sfa/managers/registry_manager.py
index
a88c9de
..
5567197
100644
(file)
--- a/
sfa/managers/registry_manager.py
+++ b/
sfa/managers/registry_manager.py
@@
-625,7
+625,7
@@
class RegistryManager:
for command in all_commands:
(status, output) = commands.getstatusoutput(command)
if status:
for command in all_commands:
(status, output) = commands.getstatusoutput(command)
if status:
- raise Exception
, output
+ raise Exception
(output)
for filename in [key_filename, gid_filename]:
os.unlink(filename)
for filename in [key_filename, gid_filename]:
os.unlink(filename)
diff --git
a/sfa/nitos/nitosdriver.py
b/sfa/nitos/nitosdriver.py
index
40db2a7
..
8e3da34
100644
(file)
--- a/
sfa/nitos/nitosdriver.py
+++ b/
sfa/nitos/nitosdriver.py
@@
-668,7
+668,7
@@
class NitosDriver (Driver):
# xxx this code is quite old and has not run for ages
# it is obviously totally broken and needs a rewrite
def get_ticket (self, slice_urn, slice_hrn, creds, rspec_string, options):
# xxx this code is quite old and has not run for ages
# it is obviously totally broken and needs a rewrite
def get_ticket (self, slice_urn, slice_hrn, creds, rspec_string, options):
- raise SfaNotImplemented
,"NitosDriver.get_ticket needs a rewrite"
+ raise SfaNotImplemented
("NitosDriver.get_ticket needs a rewrite")
# please keep this code for future reference
# slices = PlSlices(self)
# peer = slices.get_peer(slice_hrn)
# please keep this code for future reference
# slices = PlSlices(self)
# peer = slices.get_peer(slice_hrn)
diff --git
a/sfa/nitos/nitosshell.py
b/sfa/nitos/nitosshell.py
index
269e367
..
2636e6d
100644
(file)
--- a/
sfa/nitos/nitosshell.py
+++ b/
sfa/nitos/nitosshell.py
@@
-33,7
+33,7
@@
class NitosShell:
actual_name=None
if name in NitosShell.direct_calls: actual_name=name
if not actual_name:
actual_name=None
if name in NitosShell.direct_calls: actual_name=name
if not actual_name:
- raise Exception
, "Illegal method call %s for NITOS driver"%(name
)
+ raise Exception
("Illegal method call %s for NITOS driver"%(name)
)
actual_name = "scheduler.server." + actual_name
result=getattr(self.proxy, actual_name)(*args, **kwds)
logger.debug('NitosShell %s (%s) returned ... '%(name,actual_name))
actual_name = "scheduler.server." + actual_name
result=getattr(self.proxy, actual_name)(*args, **kwds)
logger.debug('NitosShell %s (%s) returned ... '%(name,actual_name))
diff --git
a/sfa/planetlab/plshell.py
b/sfa/planetlab/plshell.py
index
16af128
..
15c58b6
100644
(file)
--- a/
sfa/planetlab/plshell.py
+++ b/
sfa/planetlab/plshell.py
@@
-89,7
+89,7
@@
class PlShell:
if name in PlShell.direct_calls: actual_name=name
if name in PlShell.alias_calls: actual_name=PlShell.alias_calls[name]
if not actual_name:
if name in PlShell.direct_calls: actual_name=name
if name in PlShell.alias_calls: actual_name=PlShell.alias_calls[name]
if not actual_name:
- raise Exception
, "Illegal method call %s for PL driver"%(name
)
+ raise Exception
("Illegal method call %s for PL driver"%(name)
)
result=getattr(self.proxy, actual_name)(self.plauth, *args, **kwds)
logger.debug('PlShell %s (%s) returned ... '%(name,actual_name))
return result
result=getattr(self.proxy, actual_name)(self.plauth, *args, **kwds)
logger.debug('PlShell %s (%s) returned ... '%(name,actual_name))
return result
diff --git
a/sfa/rspecs/elements/versions/ofeliav1Port.py
b/sfa/rspecs/elements/versions/ofeliav1Port.py
index
f4cf74d
..
009d551
100644
(file)
--- a/
sfa/rspecs/elements/versions/ofeliav1Port.py
+++ b/
sfa/rspecs/elements/versions/ofeliav1Port.py
@@
-8,7
+8,7
@@
class Ofeliav1Port:
@staticmethod
def add_portrs(xml, ports):
@staticmethod
def add_portrs(xml, ports):
- raise Exception
, "not implemented yet"
+ raise Exception
("not implemented yet")
if not ports:
return
if not isinstance(ports, list):
if not ports:
return
if not isinstance(ports, list):
@@
-22,7
+22,7
@@
class Ofeliav1Port:
@staticmethod
def add_port_attribute(xml, name, value):
@staticmethod
def add_port_attribute(xml, name, value):
- raise Exception
, "not implemented yet"
+ raise Exception
("not implemented yet")
elem = xml.add_element(name)
elem.set_text(value)
elem = xml.add_element(name)
elem.set_text(value)
diff --git
a/sfa/rspecs/versions/ofeliav1.py
b/sfa/rspecs/versions/ofeliav1.py
index
ff4ae42
..
0608e7a
100755
(executable)
--- a/
sfa/rspecs/versions/ofeliav1.py
+++ b/
sfa/rspecs/versions/ofeliav1.py
@@
-30,7
+30,7
@@
class Ofelia(RSpecVersion):
# Network
def get_networks(self):
# Network
def get_networks(self):
- raise Exception
, "Not implemented"
+ raise Exception
("Not implemented")
network_elems = self.xml.xpath('//network')
networks = [network_elem.get_instance(fields=['name', 'slice']) for \
network_elem in network_elems]
network_elems = self.xml.xpath('//network')
networks = [network_elem.get_instance(fields=['name', 'slice']) for \
network_elem in network_elems]
@@
-38,7
+38,7
@@
class Ofelia(RSpecVersion):
def add_network(self, network):
def add_network(self, network):
- raise Exception
, "Not implemented"
+ raise Exception
("Not implemented")
network_tags = self.xml.xpath('//network[@name="%s"]' % network)
if not network_tags:
network_tag = self.xml.add_element('network', name=network)
network_tags = self.xml.xpath('//network[@name="%s"]' % network)
if not network_tags:
network_tag = self.xml.add_element('network', name=network)
diff --git
a/sfa/server/xmlrpcapi.py
b/sfa/server/xmlrpcapi.py
index
b6f8e95
..
8b8bd78
100644
(file)
--- a/
sfa/server/xmlrpcapi.py
+++ b/
sfa/server/xmlrpcapi.py
@@
-71,7
+71,7
@@
def xmlrpclib_dump(self, value, write):
if isinstance(value, Type):
f(*args)
return
if isinstance(value, Type):
f(*args)
return
- raise TypeError
, "cannot marshal %s objects" % type(value
)
+ raise TypeError
("cannot marshal %s objects" % type(value)
)
else:
f(*args)
else:
f(*args)
@@
-102,7
+102,7
@@
class XmlrpcApi:
"""
# Look up method
if method not in self.methods:
"""
# Look up method
if method not in self.methods:
- raise SfaInvalidAPIMethod
, method
+ raise SfaInvalidAPIMethod
(method)
# Get new instance of method
try:
# Get new instance of method
try:
@@
-112,7
+112,7
@@
class XmlrpcApi:
return getattr(module, classname)(self)
except (ImportError, AttributeError):
self.logger.log_exc("Error importing method: %s" % method)
return getattr(module, classname)(self)
except (ImportError, AttributeError):
self.logger.log_exc("Error importing method: %s" % method)
- raise SfaInvalidAPIMethod
, method
+ raise SfaInvalidAPIMethod
(method)
def call(self, source, method, *args):
"""
def call(self, source, method, *args):
"""
diff --git
a/sfa/storage/alchemy.py
b/sfa/storage/alchemy.py
index
f052fba
..
fb8dfac
100644
(file)
--- a/
sfa/storage/alchemy.py
+++ b/
sfa/storage/alchemy.py
@@
-39,7
+39,7
@@
class Alchemy:
except:
pass
self.engine=None
except:
pass
self.engine=None
- raise Exception
,"Could not connect to database %s as %s with psycopg2"%(dbname,config.SFA_DB_USER
)
+ raise Exception
("Could not connect to database %s as %s with psycopg2"%(dbname,config.SFA_DB_USER)
)
# expects boolean True: debug is ON or False: debug is OFF
# expects boolean True: debug is ON or False: debug is OFF
diff --git
a/sfa/storage/parameter.py
b/sfa/storage/parameter.py
index
e520bfc
..
6737d0b
100644
(file)
--- a/
sfa/storage/parameter.py
+++ b/
sfa/storage/parameter.py
@@
-100,4
+100,4
@@
def xmlrpc_type(arg):
# documentation purposes.
return "mixed"
else:
# documentation purposes.
return "mixed"
else:
- raise SfaAPIError
, "XML-RPC cannot marshal %s objects" % arg_type
+ raise SfaAPIError
("XML-RPC cannot marshal %s objects" % arg_type)
diff --git
a/sfa/storage/record.py
b/sfa/storage/record.py
index
3a9c315
..
9622268
100644
(file)
--- a/
sfa/storage/record.py
+++ b/
sfa/storage/record.py
@@
-88,7
+88,7
@@
class Record:
elif format == 'simple':
print(self.dump_simple())
else:
elif format == 'simple':
print(self.dump_simple())
else:
- raise Exception
, "Invalid format %s" % format
+ raise Exception
("Invalid format %s" % format)
def dump_text(self, dump_parents=False, sort=False):
print(40*'=')
def dump_text(self, dump_parents=False, sort=False):
print(40*'=')
diff --git
a/sfa/trust/certificate.py
b/sfa/trust/certificate.py
index
6b1e260
..
6f3ecc6
100644
(file)
--- a/
sfa/trust/certificate.py
+++ b/
sfa/trust/certificate.py
@@
-90,11
+90,11
@@
def test_passphrase(string, passphrase):
def convert_public_key(key):
keyconvert_path = "/usr/bin/keyconvert.py"
if not os.path.isfile(keyconvert_path):
def convert_public_key(key):
keyconvert_path = "/usr/bin/keyconvert.py"
if not os.path.isfile(keyconvert_path):
- raise IOError
, "Could not find keyconvert in %s" % keyconvert_path
+ raise IOError
("Could not find keyconvert in %s" % keyconvert_path)
# we can only convert rsa keys
if "ssh-dss" in key:
# we can only convert rsa keys
if "ssh-dss" in key:
- raise Exception
, "keyconvert: dss keys are not supported"
+ raise Exception
("keyconvert: dss keys are not supported")
(ssh_f, ssh_fn) = tempfile.mkstemp()
ssl_fn = tempfile.mktemp()
(ssh_f, ssh_fn) = tempfile.mkstemp()
ssl_fn = tempfile.mktemp()
@@
-108,7
+108,7
@@
def convert_public_key(key):
# that it can be expected to see why it failed.
# TODO: for production, cleanup the temporary files
if not os.path.exists(ssl_fn):
# that it can be expected to see why it failed.
# TODO: for production, cleanup the temporary files
if not os.path.exists(ssl_fn):
- raise Exception
, "keyconvert: generated certificate not found. keyconvert may have failed."
+ raise Exception
("keyconvert: generated certificate not found. keyconvert may have failed.")
k = Keypair()
try:
k = Keypair()
try:
@@
-570,7
+570,7
@@
class Certificate:
if self.isCA != None:
# Can't double set properties
if self.isCA != None:
# Can't double set properties
- raise Exception
, "Cannot set basicConstraints CA:?? more than once. Was %s, trying to set as %s" % (self.isCA, val
)
+ raise Exception
("Cannot set basicConstraints CA:?? more than once. Was %s, trying to set as %s" % (self.isCA, val)
)
self.isCA = val
if val:
self.isCA = val
if val:
diff --git
a/sfa/util/method.py
b/sfa/util/method.py
index
e7bdee7
..
4e21170
100644
(file)
--- a/
sfa/util/method.py
+++ b/
sfa/util/method.py
@@
-250,20
+250,20
@@
class Method:
if expected_type in StringTypes:
if min is not None and \
len(value.encode(self.api.encoding)) < min:
if expected_type in StringTypes:
if min is not None and \
len(value.encode(self.api.encoding)) < min:
- raise SfaInvalidArgument
, "%s must be at least %d bytes long" % (name, min
)
+ raise SfaInvalidArgument
("%s must be at least %d bytes long" % (name, min)
)
if max is not None and \
len(value.encode(self.api.encoding)) > max:
if max is not None and \
len(value.encode(self.api.encoding)) > max:
- raise SfaInvalidArgument
, "%s must be at most %d bytes long" % (name, max
)
+ raise SfaInvalidArgument
("%s must be at most %d bytes long" % (name, max)
)
elif expected_type in (list, tuple, set):
if min is not None and len(value) < min:
elif expected_type in (list, tuple, set):
if min is not None and len(value) < min:
- raise SfaInvalidArgument
, "%s must contain at least %d items" % (name, min
)
+ raise SfaInvalidArgument
("%s must contain at least %d items" % (name, min)
)
if max is not None and len(value) > max:
if max is not None and len(value) > max:
- raise SfaInvalidArgument
, "%s must contain at most %d items" % (name, max
)
+ raise SfaInvalidArgument
("%s must contain at most %d items" % (name, max)
)
else:
if min is not None and value < min:
else:
if min is not None and value < min:
- raise SfaInvalidArgument
, "%s must be > %s" % (name, str(min
))
+ raise SfaInvalidArgument
("%s must be > %s" % (name, str(min)
))
if max is not None and value > max:
if max is not None and value > max:
- raise SfaInvalidArgument
, "%s must be < %s" % (name, str(max
))
+ raise SfaInvalidArgument
("%s must be < %s" % (name, str(max)
))
# If a list with particular types of items is expected
if isinstance(expected, (list, tuple, set)):
# If a list with particular types of items is expected
if isinstance(expected, (list, tuple, set)):
diff --git
a/sfa/util/storage.py
b/sfa/util/storage.py
index
89a2509
..
9033434
100644
(file)
--- a/
sfa/util/storage.py
+++ b/
sfa/util/storage.py
@@
-19,8
+19,8
@@
class SimpleStorage(dict):
db_file = open(self.db_filename, 'r')
dict.__init__(self, eval(db_file.read()))
elif os.path.exists(self.db_filename) and not os.path.isfile(self.db_filename):
db_file = open(self.db_filename, 'r')
dict.__init__(self, eval(db_file.read()))
elif os.path.exists(self.db_filename) and not os.path.isfile(self.db_filename):
- raise IOError
,
'%s exists but is not a file. please remove it and try again' \
- % self.db_filename
+ raise IOError
(
'%s exists but is not a file. please remove it and try again' \
+ % self.db_filename
)
else:
self.write()
self.load()
else:
self.write()
self.load()
@@
-49,8
+49,8
@@
class XmlStorage(SimpleStorage):
xml = XML(self.db_filename)
dict.__init__(self, xml.todict())
elif os.path.exists(self.db_filename) and not os.path.isfile(self.db_filename):
xml = XML(self.db_filename)
dict.__init__(self, xml.todict())
elif os.path.exists(self.db_filename) and not os.path.isfile(self.db_filename):
- raise IOError
,
'%s exists but is not a file. please remove it and try again' \
- % self.db_filename
+ raise IOError
(
'%s exists but is not a file. please remove it and try again' \
+ % self.db_filename
)
else:
self.write()
self.load()
else:
self.write()
self.load()
diff --git
a/sfa/util/xrn.py
b/sfa/util/xrn.py
index
b16ea51
..
6198f83
100644
(file)
--- a/
sfa/util/xrn.py
+++ b/
sfa/util/xrn.py
@@
-162,7
+162,7
@@
class Xrn:
def get_hrn_type(self): return (self.hrn, self.type)
def _normalize(self):
def get_hrn_type(self): return (self.hrn, self.type)
def _normalize(self):
- if self.hrn is None: raise SfaAPIError
, "Xrn._normalize"
+ if self.hrn is None: raise SfaAPIError
("Xrn._normalize")
if not hasattr(self,'leaf'):
self.leaf=Xrn.hrn_split(self.hrn)[-1]
# self.authority keeps a list
if not hasattr(self,'leaf'):
self.leaf=Xrn.hrn_split(self.hrn)[-1]
# self.authority keeps a list
@@
-211,7
+211,7
@@
class Xrn:
# if not self.urn or not self.urn.startswith(Xrn.URN_PREFIX):
if not Xrn.is_urn(self.urn):
# if not self.urn or not self.urn.startswith(Xrn.URN_PREFIX):
if not Xrn.is_urn(self.urn):
- raise SfaAPIError
, "Xrn.urn_to_hrn"
+ raise SfaAPIError
("Xrn.urn_to_hrn")
parts = Xrn.urn_split(self.urn)
type=parts.pop(2)
parts = Xrn.urn_split(self.urn)
type=parts.pop(2)
@@
-249,7
+249,7
@@
class Xrn:
# if not self.hrn or self.hrn.startswith(Xrn.URN_PREFIX):
if Xrn.is_urn(self.hrn):
# if not self.hrn or self.hrn.startswith(Xrn.URN_PREFIX):
if Xrn.is_urn(self.hrn):
- raise SfaAPIError
, "Xrn.hrn_to_urn, hrn=%s"%self.hrn
+ raise SfaAPIError
("Xrn.hrn_to_urn, hrn=%s"%self.hrn)
if self.type and self.type.startswith('authority'):
self.authority = Xrn.hrn_auth_list(self.hrn)
if self.type and self.type.startswith('authority'):
self.authority = Xrn.hrn_auth_list(self.hrn)
diff --git
a/sfatables/commands/moo.py
b/sfatables/commands/moo.py
index
bd8c88e
..
bd19a9d
100644
(file)
--- a/
sfatables/commands/moo.py
+++ b/
sfatables/commands/moo.py
@@
-170,20
+170,20
@@
class Command:
if expected_type in StringTypes:
if min is not None and \
len(value.encode(self.api.encoding)) < min:
if expected_type in StringTypes:
if min is not None and \
len(value.encode(self.api.encoding)) < min:
- raise SfaInvalidArgument
, "%s must be at least %d bytes long" % (name, min
)
+ raise SfaInvalidArgument
("%s must be at least %d bytes long" % (name, min)
)
if max is not None and \
len(value.encode(self.api.encoding)) > max:
if max is not None and \
len(value.encode(self.api.encoding)) > max:
- raise SfaInvalidArgument
, "%s must be at most %d bytes long" % (name, max
)
+ raise SfaInvalidArgument
("%s must be at most %d bytes long" % (name, max)
)
elif expected_type in (list, tuple, set):
if min is not None and len(value) < min:
elif expected_type in (list, tuple, set):
if min is not None and len(value) < min:
- raise SfaInvalidArgument
, "%s must contain at least %d items" % (name, min
)
+ raise SfaInvalidArgument
("%s must contain at least %d items" % (name, min)
)
if max is not None and len(value) > max:
if max is not None and len(value) > max:
- raise SfaInvalidArgument
, "%s must contain at most %d items" % (name, max
)
+ raise SfaInvalidArgument
("%s must contain at most %d items" % (name, max)
)
else:
if min is not None and value < min:
else:
if min is not None and value < min:
- raise SfaInvalidArgument
, "%s must be > %s" % (name, str(min
))
+ raise SfaInvalidArgument
("%s must be > %s" % (name, str(min)
))
if max is not None and value > max:
if max is not None and value > max:
- raise SfaInvalidArgument
, "%s must be < %s" % (name, str(max
))
+ raise SfaInvalidArgument
("%s must be < %s" % (name, str(max)
))
# If a list with particular types of items is expected
if isinstance(expected, (list, tuple, set)):
# If a list with particular types of items is expected
if isinstance(expected, (list, tuple, set)):
diff --git
a/wsdl/sfa2wsdl.py
b/wsdl/sfa2wsdl.py
index
a9e3c32
..
2ec1307
100755
(executable)
--- a/
wsdl/sfa2wsdl.py
+++ b/
wsdl/sfa2wsdl.py
@@
-166,7
+166,7
@@
class WSDLGen:
return "xsd:string"
else:
pdb.set_trace()
return "xsd:string"
else:
pdb.set_trace()
- raise SoapError
, "Cannot handle %s objects" % arg_type
+ raise SoapError
("Cannot handle %s objects" % arg_type)
def param_type(self, arg):
return (self.name_complex_type(arg))
def param_type(self, arg):
return (self.name_complex_type(arg))