Skip to content

Commit

Permalink
Added support for upload/run of regular exe
Browse files Browse the repository at this point in the history
  • Loading branch information
bwatters-r7 committed Apr 20, 2018
1 parent 6ea3d0a commit 0a6b2b5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions samples/manageServices.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ def runScript(vmObject, actionData):
print("CAUGHT EXCEPTION: " + str(e))
return retVal

def runExe(vmObject, actionData):
localFileName = actionData['FILENAME']
remoteFileName = actionData['UPLOAD_DIR'] + "\\" + localFileName.split('/')[-1]
retVal = False
try:
retVal = vmObject.uploadAndRun(localFileName, remoteFileName, "", True)
except Exception as e:
print("CAUGHT EXCEPTION: " + str(e))
return retVal


def checkSuccess(vmObject, actionData):
retVal = False
Expand All @@ -81,6 +91,8 @@ def executeAction(vmObject, actionData):
try:
if actionData['TYPE'] == "COMMANDS":
retVal = runCommands(vmObject, actionData)
if actionData['TYPE'] == "EXE":
retVal = runExe(vmObject, actionData)
if actionData['TYPE'] == "SCRIPT":
retVal = runScript(vmObject, actionData)
time.sleep(scheduleDelay)
Expand Down Expand Up @@ -178,6 +190,7 @@ def main():
print("VM CREDENTIALS REQUIRED FOR THIS OPERATION")
exit(0)

credsDictionary = None
if args.credsFile is not None:
credsDictionary = sampleLib.loadJsonFile(args.credsFile)
if credsDictionary is None:
Expand Down

0 comments on commit 0a6b2b5

Please sign in to comment.