X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fvsys_privs.py;fp=plugins%2Fvsys_privs.py;h=bf3b1d1f21a8bed743e05792f1f314df589674fe;hb=1b4f53e648b13f7629970787b6ec03387e2d966a;hp=01ab283fe2f8fc02870b1292f26bce22c87f2d76;hpb=9e596e6eb3c871ab25837903b0ed30f165d9d688;p=nodemanager.git diff --git a/plugins/vsys_privs.py b/plugins/vsys_privs.py index 01ab283..bf3b1d1 100755 --- a/plugins/vsys_privs.py +++ b/plugins/vsys_privs.py @@ -64,11 +64,12 @@ def read_privs(): pass for tagname in tagnames: - tagfile = os.path.join(slicedir,tagname) - values_n = file(tagfile).readlines() - values = map(lambda s:s.rstrip(),values_n) - slice = os.path.basename(slicedir) - cur_privs[slice][tagname]=values + tagfilename = os.path.join(slicedir,tagname) + with open(tagfilename) as tagfile: + values_n = tagfile.readlines() + values = [ v.rstrip() for v in values_n ] + slice = os.path.basename(slicedir) + cur_privs[slice][tagname] = values return cur_privs