check if there is conditions for the creation or not and added support for running multiples commands at once
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e6dd3d81ce
commit
a659323779
@ -44,14 +44,15 @@ def are_all_conditions_met(lxc: LXC):
|
|||||||
# result.append(lxc.run_command("which " + program, return_status_code=True) == 0)
|
# result.append(lxc.run_command("which " + program, return_status_code=True) == 0)
|
||||||
|
|
||||||
creation = lxc.get_creation()
|
creation = lxc.get_creation()
|
||||||
global_conditions = creation["conditions"]
|
|
||||||
steps = creation["steps"]
|
steps = creation["steps"]
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
# Check the global conditions
|
if 'conditions' in creation:
|
||||||
for condition_type in global_conditions:
|
global_conditions = creation["conditions"]
|
||||||
result = check_conditions(c_type=condition_type, parent=global_conditions, lxc=lxc, result=result)
|
|
||||||
|
# Check the global conditions
|
||||||
|
for condition_type in global_conditions:
|
||||||
|
result = check_conditions(c_type=condition_type, parent=global_conditions, lxc=lxc, result=result)
|
||||||
|
|
||||||
# Check the specific conditions for each step
|
# Check the specific conditions for each step
|
||||||
for step in steps:
|
for step in steps:
|
||||||
|
@ -386,6 +386,13 @@ class LXC(LinuxMachine):
|
|||||||
|
|
||||||
# logging.debug(f"Running command {command} on LXC {self.lxc_id}")
|
# logging.debug(f"Running command {command} on LXC {self.lxc_id}")
|
||||||
|
|
||||||
|
if type(command) == list:
|
||||||
|
for cmd in command:
|
||||||
|
self.run_command(command=cmd, return_status_code=return_status_code,
|
||||||
|
exception_on_exit=exception_on_exit,
|
||||||
|
exception_on_empty_stdout=exception_on_empty_stdout,
|
||||||
|
working_directory=working_directory, use_ssh=use_ssh)
|
||||||
|
|
||||||
if working_directory:
|
if working_directory:
|
||||||
command = f"cd {working_directory} && {command}"
|
command = f"cd {working_directory} && {command}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user