Refine Vagrantfile location
Read from script directory if run from Git checkout and from /usr/share/ if run from a packaged installation. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
parent
c0af9d8a68
commit
7024eb6fae
10
scullery.py
10
scullery.py
@ -40,6 +40,14 @@ vmprefix = 'scullery'
|
||||
cwd = os.getcwd()
|
||||
sshfile='{}/.scullery_ssh'.format(cwd)
|
||||
envfile='{}/.scullery_env'.format(cwd)
|
||||
vagfile='Vagrantfile-Template'
|
||||
|
||||
# replaced in scullery.spec
|
||||
is_packaged = False
|
||||
if is_packaged:
|
||||
vagfile='/usr/share/scullery/{}'.format(vagfile)
|
||||
else:
|
||||
vagfile='{}/{}'.format(os.path.abspath(os.path.dirname(__file__)), vagfile)
|
||||
|
||||
def _abort(msg):
|
||||
log.error(msg)
|
||||
@ -163,7 +171,7 @@ def main_interactive():
|
||||
_abort('Suite referencs an undefined box')
|
||||
box_name = boxconf.get('name', None)
|
||||
box_image = boxconf.get('image', None)
|
||||
box_file = boxconf.get('file', '{}/Vagrantfile-Template'.format(os.path.abspath(os.path.dirname(__file__))))
|
||||
box_file = boxconf.get('file', vagfile)
|
||||
if None in [box_name, box_image, box_file]:
|
||||
_abort('Box configuration is incomplete')
|
||||
box_bootstrap = boxconf.get('bootstrap', None)
|
||||
|
Loading…
Reference in New Issue
Block a user