X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=sfa%2Futil%2Fxrn.py;h=a503e713e3bb642c442de65dedb3ff713e94f36d;hp=eb0d39e472516cafec4337ab64a7afc1b5729851;hb=ba2aaa438f939a4b5c697052e37b1c3218901319;hpb=06b330f0ee047bdb107e43e82b1d7356c876bc15 diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index eb0d39e4..a503e713 100644 --- a/sfa/util/xrn.py +++ b/sfa/util/xrn.py @@ -61,6 +61,7 @@ class Xrn: # self.path # provide either urn, or (hrn + type) def __init__ (self, xrn=None, urn=None, hrn=None, type=None): + # user has specified xrn : guess if urn or hrn if xrn is not None: if xrn.startswith(Xrn.URN_PREFIX): self.urn=xrn @@ -69,13 +70,16 @@ class Xrn: self.hrn=xrn self.type=type self.hrn_to_urn() + # user has specified urn, let's use it elif urn is not None: self.urn=urn self.urn_to_hrn() + # user has specified hrn and type elif hrn is not None and type is not None: self.hrn=hrn self.type=type self.hrn_to_urn() + # what should we do ? else: raise SfaAPIError,"Xrn.__init__" # happens all the time ..