try to fix the case the *_ROOT dir is not in sys.path
This commit is contained in:
11
frappyman.py
11
frappyman.py
@@ -46,7 +46,11 @@ class Config:
|
||||
def get(cls, cfgfile):
|
||||
if not cls.process_file:
|
||||
import logging
|
||||
from frappy.config import process_file
|
||||
try:
|
||||
from frappy.config import process_file
|
||||
except Exception as e:
|
||||
print(sys.path)
|
||||
raise
|
||||
from frappy.lib import generalConfig
|
||||
generalConfig.init()
|
||||
cls.log = logging.getLogger('frappyman')
|
||||
@@ -165,9 +169,7 @@ class FrappyManager(ServiceManager):
|
||||
return [i for i in ins_list if i in cfgs]
|
||||
|
||||
def get_nodes(self, ins='', service=None):
|
||||
start_dir = ServiceManager.prepare_start(self, ins, None)[0]
|
||||
if start_dir not in sys.path:
|
||||
sys.path.insert(0, start_dir)
|
||||
ServiceManager.prepare_start(self, ins, None)
|
||||
nodes = []
|
||||
services = self.services if service is None else [service]
|
||||
for service in services:
|
||||
@@ -301,6 +303,7 @@ class FrappyManager(ServiceManager):
|
||||
def do_listcfg(self, ins='', service='', prt=print):
|
||||
if not ins:
|
||||
raise UsageError('missing instance')
|
||||
ServiceManager.prepare_start(self, ins, service)
|
||||
self.all_cfg(ins, service, True)
|
||||
seacfgpat = re.compile(r'(.*)(\.config|\.stick|\.addon)')
|
||||
keylen = max((max(len(k) for k in cfgs) for cfgs in self.list_info.values()), default=1)
|
||||
|
||||
Reference in New Issue
Block a user