Skip to content

Commit

Permalink
Fix execute command + enqueue
Browse files Browse the repository at this point in the history
Fix execute command + add enqueue_command
  • Loading branch information
ayeleta committed Jan 6, 2017
1 parent 8ad303d commit 8674d7e
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions sandbox_scripts/QualiEnvironmentUtils/Sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,36 @@ def execute_command(self, commandName, commandInputs=[], printOutput=False):
"""
Executes a command
:param str commandName: Command Name - Specify the name of the command.
:param list[str] commandInputs: Command Inputs - Specify a matrix of input names and values
:param list[InputNameValue] commandInputs: Command Inputs - Specify a matrix of input names and values
required for executing the command.
:param bool printOutput: Print Output - Defines whether to print the command output
in the Sandbox command output window.
:rtype: CommandExecutionCompletedResultInfo
"""
try:
return self.api_session.ExecuteTopologyCommand(reservationId=self.id, commandName=commandName,
parameterValues=commandInputs, printOutput=printOutput)
return self.api_session.ExecuteEnvironmentCommand(self.id, commandName, commandInputs, printOutput)

except CloudShellAPIError as error:
raise QualiError(self.id, error.message)

# -----------------------------------------
# -----------------------------------------
def enqueue_command(self, commandName, commandInputs=[], printOutput=False):
"""
Enqueue a command
:param str commandName: Command Name - Specify the name of the command.
:param list[InputNameValue] commandInputs: Command Inputs - Specify a matrix of input names and values
required for executing the command.
:param bool printOutput: Print Output - Defines whether to print the command output
in the Sandbox command output window.
:rtype: CommandExecutionCompletedResultInfo
"""
try:
return self.api_session.EnqueueEnvironmentCommand(self.id, commandName, commandInputs, printOutput)

except CloudShellAPIError as error:
raise QualiError(self.id, error.message)

# -----------------------------------------
# -----------------------------------------
def save_sandbox_as_blueprint(self, blueprint_name, write_to_output=True):
Expand Down

0 comments on commit 8674d7e

Please sign in to comment.