From: Thierry Parmentelat Date: Thu, 8 Sep 2011 12:24:13 +0000 (+0200) Subject: cleanup for using the config dir properly, and not an hard-wired ~/.sfi/ X-Git-Tag: sface-0.1-19~14 X-Git-Url: http://git.onelab.eu/?p=sface.git;a=commitdiff_plain;h=ab5bd9742a2d1b306e1a65b7f37c46f602c3fdd3 cleanup for using the config dir properly, and not an hard-wired ~/.sfi/ --- diff --git a/sface/config.py b/sface/config.py index bf94cbc..edb2924 100644 --- a/sface/config.py +++ b/sface/config.py @@ -1,7 +1,7 @@ # config for sface # uses in this order # command-line args -# ~/.sfi/sfi_config +# /sfi_config ### import os @@ -28,9 +28,8 @@ class Config: ] def __init__ (self): - print 'WARNING - should pass config dir' - self.dirname=os.path.expanduser("~/.sfi/") - self.read_config() + # no need to do anything here, we need set_dirname later on + pass def get_dirname (self): return self.dirname diff --git a/sface/sfiprocess.py b/sface/sfiprocess.py index f794c63..e06bf9a 100644 --- a/sface/sfiprocess.py +++ b/sface/sfiprocess.py @@ -89,7 +89,7 @@ class SfiProcess(QObject): def __getRSpec(self, mgr): slice = config.getSlice() # Write RSpec to file for testing. - filename = os.path.expanduser("~/.sfi/" + slice + ".rspec") + filename = config.fullpath ("%s.rspec"%slice) try: os.remove(filename) except: diff --git a/sface/sfirenew.py b/sface/sfirenew.py index 863b253..17cd8d6 100644 --- a/sface/sfirenew.py +++ b/sface/sfirenew.py @@ -44,7 +44,7 @@ class SfiRenewer(QObject): def finishedUpdateRecord(self): # we have to force sfi.py to download an updated slice credential - sliceCredName = os.path.expanduser("~/.sfi/slice_" + self.hrn.split(".")[-1] + ".cred") + sliceCredName = config.fullpath("slice_" + self.hrn.split(".")[-1] + ".cred") if os.path.exists(sliceCredName): os.remove(sliceCredName)