Skip to content

Commit

Permalink
Now performing actions for runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
nrchandan committed Feb 18, 2014
1 parent e78caed commit d9b7c39
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/VMManager/LabActionRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LabActionRunner:
This object is driven by the lab-requirements specification.
"""
def __init__(self, actions, path_prefix):
def __init__(self, actions, path_prefix=""):
self._actions = actions
self._path_prefix = path_prefix

Expand Down
21 changes: 17 additions & 4 deletions src/VMManager/VMManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,17 @@ def test_lab(lab_src_url, version=None):
# instantiate the object

def get_build_steps_spec(lab_spec):
return {"build_steps": lab_spec['lab'][u'build_requirements']['platform']['build_steps']}
return {"build_steps": lab_spec['lab']['build_requirements']['platform']['build_steps']}

def get_installer_steps_spec(lab_spec):
def get_build_installer_steps_spec(lab_spec):
return {"installer": lab_spec['lab']['build_requirements']['platform']['installer']}

def get_runtime_installer_steps(lab_spec):
return {"installer": lab_spec['lab']['runtime_requirements']['platform']['installer']}

def get_runtime_actions_steps(lab_spec):
return lab_spec['lab']['runtime_requirements']['platform']['lab_actions']

def construct_repo_name():
repo = lab_src_url.split('/')[-1]
repo_name = repo[:-4] if repo[-4:] == ".git" else repo
Expand Down Expand Up @@ -141,12 +147,19 @@ def get_lab_spec(repo_name):

lab_spec = get_lab_spec(repo_name)
try:
lar = LabActionRunner(get_installer_steps_spec(lab_spec), "")
lar = LabActionRunner(get_build_installer_steps_spec(lab_spec))
lar.run_install_source()

lar = LabActionRunner(get_build_steps_spec(lab_spec), "")
lar = LabActionRunner(get_build_steps_spec(lab_spec))
lar.run_build_steps()

lar = LabActionRunner(get_runtime_installer_steps(lab_spec))
lar.run_install_source()

lar = LabActionRunner(get_runtime_actions_steps(lab_spec))
lar.run_init_lab()
lar.run_start_lab()

return "Success"
except Exception, e:
VMM_LOGGER.error("VMManager.test_lab failed: " + str(e))
Expand Down

0 comments on commit d9b7c39

Please sign in to comment.