From: Tony Mack Date: Tue, 16 Dec 2008 03:09:24 +0000 (+0000) Subject: in get_authority, return the hrn as is if it is only 1 level deep X-Git-Tag: sfa-0.9-0@14641~794 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ca5d75e0528c684b4ea11ab7fc1227631c25fcba;p=sfa.git in get_authority, return the hrn as is if it is only 1 level deep --- diff --git a/util/misc.py b/util/misc.py index 90c257b4..b2e2b8ea 100644 --- a/util/misc.py +++ b/util/misc.py @@ -5,8 +5,10 @@ def get_leaf(hrn): return ".".join(parts[-1:]) def get_authority(hrn): - parts = hrn.split(".") - return ".".join(parts[:-1]) + parts = hrn.split(".") + if len(parts) > 1: + return ".".join(parts[:-1]) + return hrn def get_auth_type(type): if (type=="slice") or (type=="user") or (type=="sa"):