Browse Source

update import packages

master
Gerry Nelson 5 years ago
parent
commit
e751da65e3
  1. 17
      importpackages.py
  2. 3
      snapshotreports.py

17
importpackages.py

@ -15,18 +15,23 @@
# Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. # Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. # OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
# #
# change log # change log
# renamed to importpackages.py to be more descriptive of actual usage # renamed to importpackages.py to be more descriptive of actual usage
# #
# Import Python modules # Import Python modules
import argparse, sys, subprocess, os, json import argparse, sys, subprocess, os, json
from sharedfunctions import callrestapi from sharedfunctions import callrestapi
# 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=propertylist["sascli.location"]
cliexe=propertylist["sascli.executable"]
clicommand=os.path.join(clidir,cliexe)
# get input parameters # get input parameters
parser = argparse.ArgumentParser(description="Import JSON files from directory. All json files in directory will be imported.") parser = argparse.ArgumentParser(description="Import JSON files from directory. All json files in directory will be imported.")
@ -36,7 +41,7 @@ args= parser.parse_args()
basedir=args.directory basedir=args.directory
quietmode=args.quiet quietmode=args.quiet
# get python version # get python version
version=int(str(sys.version_info[0])) version=int(str(sys.version_info[0]))
@ -46,7 +51,7 @@ if not quietmode:
if version > 2: if version > 2:
areyousure=input("WARNING: If content from the packages already exists in folders it will be replaced. Continue? (Y)") areyousure=input("WARNING: If content from the packages already exists in folders it will be replaced. Continue? (Y)")
else: else:
areyousure=raw_input("WARNING:If content from the packages already exists in folders it will be replaced. Continue? (Y)") areyousure=raw_input("WARNING:If content from the packages already exists in folders it will be replaced. Continue? (Y)")
else: else:
areyousure="Y" areyousure="Y"

3
snapshotreports.py

@ -45,9 +45,6 @@ from sharedfunctions import getfolderid, callrestapi, getpath, getapplicationpro
# get python version # get python version
version=int(str(sys.version_info[0])) version=int(str(sys.version_info[0]))
# get python version
version=int(str(sys.version_info[0]))
# get cli location from properties # get cli location from properties
propertylist=getapplicationproperties() propertylist=getapplicationproperties()

Loading…
Cancel
Save