@@ -182,8 +182,9 @@ def get_hosts(self):
182
182
if os .path .isfile (conf_file ):
183
183
config_file = open (conf_file , 'r' )
184
184
self .main_file = yaml .load (config_file )
185
- elif os .path .isfile (os .path .join ((self .config ['DEFAULT' ].get ('config_file_path' ,'/etc/jsnapy' )).encode ('utf-8' ) , conf_file )):
186
- fpath = (self .config ['DEFAULT' ].get ('config_file_path' ,'/etc/jsnapy' )).encode ('utf-8' )
185
+
186
+ elif os .path .isfile (os .path .join (self .config .get ('DEFAULT' , 'config_file_path' , vars = {'config_file_path' :'/etc/jsnapy' }).encode ('utf-8' ), conf_file )):
187
+ fpath = (self .config .get ('DEFAULT' , 'config_file_path' , vars = {'config_file_path' :'/etc/jsnapy' })).encode ('utf-8' )
187
188
config_file = open (os .path .join (fpath , conf_file ), 'r' )
188
189
self .main_file = yaml .load (config_file )
189
190
else :
@@ -271,7 +272,7 @@ def generate_rpc_reply(self, dev, output_file, hostname, username):
271
272
test_files = []
272
273
for tfile in self .main_file ['tests' ]:
273
274
if not os .path .isfile (tfile ):
274
- tfile = os .path .join (( self .config [ 'DEFAULT' ] .get ('test_file_path' ,' /etc/jsnapy/testfiles') ).encode ('utf-8' ), tfile )
275
+ tfile = os .path .join (self .config .get ('DEFAULT' , ' test_file_path' , vars = { 'test_file_path' : ' /etc/jsnapy/testfiles'} ).encode ('utf-8' ), tfile )
275
276
if os .path .isfile (tfile ):
276
277
test_file = open (tfile , 'r' )
277
278
test_files .append (yaml .load (test_file ))
@@ -331,8 +332,8 @@ def login(self, output_file):
331
332
file_tag = k ['include' ]
332
333
if os .path .isfile (file_tag ):
333
334
lfile = file_tag
334
- else :
335
- lfile = os .path .join ((self .config [ 'DEFAULT' ] .get ('test_file_path' ,' /etc/jsnapy/testfiles' )).encode ('utf-8' ), file_tag )
335
+ else :
336
+ lfile = os .path .join ((self .config .get ('DEFAULT' , ' test_file_path' , vars = { 'test_file_path' : ' /etc/jsnapy/testfiles'} )).encode ('utf-8' ), file_tag )
336
337
login_file = open (lfile , 'r' )
337
338
dev_file = yaml .load (login_file )
338
339
gp = k .get ('group' , 'all' )
@@ -404,7 +405,7 @@ def connect(self, hostname, username, password, output_file):
404
405
dev .close ()
405
406
if self .args .check is True or self .args .snapcheck is True or self .args .diff is True :
406
407
if self .main_file .get ("mail" ) and self .args .diff is not True :
407
- mfile = os .path .join (( self .config [ 'DEFAULT' ] .get ('test_file_path' ,' /etc/jsnapy/testfiles') ).encode ('utf-8' ), self .main_file ['mail' ]) \
408
+ mfile = os .path .join (self .config .get ('DEFAULT' , ' test_file_path' , vars = { 'test_file_path' : ' /etc/jsnapy/testfiles'} ).encode ('utf-8' ), self .main_file ['mail' ]) \
408
409
if os .path .isfile (self .main_file ['mail' ]) is False else self .main_file ['mail' ]
409
410
if os .path .isfile (mfile ):
410
411
mail_file = open (mfile , 'r' )
0 commit comments