Browse Source

a few more sas-viya changes

master
Gerry Nelson 5 years ago
parent
commit
39f61dd13a
  1. 15
      loginviauthinfo.py
  2. 2
      snapshotreports.py

15
loginviauthinfo.py

@ -57,9 +57,14 @@ except ImportError:
from urlparse import urlparse from urlparse import urlparse
# CHANGE THIS VARIABLE IF YOUR CLI IS IN A DIFFERENT LOCATION # get cli location from properties
clidir='/opt/sas/viya/home/bin/' propertylist=getapplicationproperties()
#clidir='c:\\admincli\\'
clidir=propertylist["sascli.location"]
cliexe=propertylist["sascli.executable"]
clicommand=os.path.join(clidir,cliexe)
debug=0 debug=0
profileexists=0 profileexists=0
@ -126,8 +131,8 @@ if profileexists:
print('host: '+host) print('host: '+host)
#quote the password string for posix systems #quote the password string for posix systems
if (os.name =='posix'): command=clidir+"sas-admin --profile "+myprofile+ " auth login -u "+username+ " -p '"+password+"'" if (os.name =='posix'): command=clicommand+" --profile "+myprofile+ " auth login -u "+username+ " -p '"+password+"'"
else: command=clidir+'sas-admin --profile '+myprofile+ ' auth login -u '+username+ ' -p '+password else: command=clicommand+' --profile '+myprofile+ ' auth login -u '+username+ ' -p '+password
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
else: else:

2
snapshotreports.py

@ -173,7 +173,7 @@ if areyousure.upper() =='Y':
#time.sleep(1) #time.sleep(1)
if autotranferremove: if autotranferremove:
print(clicommand+' transfer delete --id '+package_id+"\n") print(clicommand+' transfer delete --id '+package_id+"\n")
remTransferObject = subprocess.Popen(clidir+'sas-admin transfer delete --id '+package_id, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) remTransferObject = subprocess.Popen(clicommand+' transfer delete --id '+package_id, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
remTransferObjectOutput = remTransferObject.communicate(b'Y\n') remTransferObjectOutput = remTransferObject.communicate(b'Y\n')
remTransferObject.wait() remTransferObject.wait()

Loading…
Cancel
Save