X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Futil%2Fxrn.py;h=0d5e6bf584c104625b112a58c0cb2bd9d493b145;hb=70c0126963dfa9599610cf45261ba380ddc84bfb;hp=71731d9e503f3bae295fefcdb9a641e8fb71bf73;hpb=0409ce2800654d094f31c70ec90e1eef889851a6;p=sfa.git diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index 71731d9e..0d5e6bf5 100644 --- a/sfa/util/xrn.py +++ b/sfa/util/xrn.py @@ -61,19 +61,17 @@ class Xrn: # self.path # provide either urn, or (hrn + type) def __init__ (self, xrn, type=None): + if not xrn: xrn = "" # user has specified xrn : guess if urn or hrn - if xrn is not None: - if xrn.startswith(Xrn.URN_PREFIX): - self.hrn=None - self.urn=xrn - self.urn_to_hrn() - else: - self.urn=None - self.hrn=xrn - self.type=type - self.hrn_to_urn() + if xrn.startswith(Xrn.URN_PREFIX): + self.hrn=None + self.urn=xrn + self.urn_to_hrn() else: - raise SfaAPIError,"Xrn.__init__" + self.urn=None + self.hrn=xrn + self.type=type + self.hrn_to_urn() # happens all the time .. # if not type: # sfa_logger().debug("type-less Xrn's are not safe")