Skip to content

Commit f6275e0

Browse files
author
Antonio Minondo
committed
Modified how the destination of the configuration folder 'etc' is obtained before being copied in the module 'start.py'
1 parent 9bf8bb8 commit f6275e0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

wrf4g/commands/start.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@
3232

3333
import os
3434
import sys
35-
import glob
3635
import socket
3736
import logging
38-
from os.path import exists, join
37+
from os.path import exists, join, abspath, join, dirname
3938
from drm4g import DRM4G_DIR
4039
from drm4g.commands import Daemon, Agent
41-
from wrf4g import ( WRF4G_DIR, WRF4G_DEPLOYMENT_DIR,
42-
DB4G_CONF, WRF4G_LOGGER )
40+
from wrf4g import WRF4G_DIR, DB4G_CONF, WRF4G_LOGGER
4341
from wrf4g.db import DEFAULT_DB_CONF
4442

4543
def run( arg ) :
@@ -57,10 +55,7 @@ def run( arg ) :
5755
abs_dir = join ( WRF4G_DIR , 'var' , directory )
5856
logging.debug( "Creating '%s' directory" % abs_dir )
5957
os.makedirs( abs_dir )
60-
if 'VIRTUAL_ENV' in os.environ.keys():
61-
deployment_dir = glob.glob( join( WRF4G_DEPLOYMENT_DIR, 'lib/python*/site-packages/wrf4g' ) )[0]
62-
else:
63-
deployment_dir = glob.glob( join( WRF4G_DEPLOYMENT_DIR, 'local/lib/python*/dist-packages/wrf4g' ) )[0]
58+
deployment_dir = abspath( join ( abspath( dirname( __file__ ) ), '..' ) )
6459
src = join( deployment_dir , 'etc' )
6560
print src
6661
dest = join( WRF4G_DIR, 'etc' )

0 commit comments

Comments
 (0)