Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a -P option to allow separate specification of the password or t… #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions tools/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,17 @@ def printDeployments(dep):
print ' Error: %s' % d['error']

ApigeeHost = 'https://api.enterprise.apigee.com'
UserPW = None
User = None
PW = None
Directory = None
Organization = None
Environment = None
Name = None
BasePath = '/'
ShouldDeploy = True
PassSpecified = False

Options = 'h:u:d:e:n:p:o:i:z:'
Options = 'h:u:d:e:n:p:o:i:z:P:'

opts = getopt.getopt(sys.argv[1:], Options)[0]

Expand All @@ -143,26 +145,39 @@ def printDeployments(dep):
elif o[0] == '-p':
BasePath = o[1]
elif o[0] == '-u':
UserPW = o[1]
User = o[1]
elif o[0] == '-P':
PW = o[1]
PassSpecified = True
elif o[0] == '-i':
ShouldDeploy = False
elif o[0] == '-z':
ZipFile = o[1]
if PW == '!':
PW = raw_input("Password: ")
PW = str(PW)

if UserPW == None or \
if User == None or \
(Directory == None and ZipFile == None) or \
Environment == None or \
Name == None or \
Organization == None:
Organization == None or \
(PW == None and PassSpecified == True):
print """Usage: deploy -n [name] (-d [directory name] | -z [zipfile])
-e [environment] -u [username:password] -o [organization]
[-p [base path] -h [apigee API url] -i]
-e [environment] (-u [username:password] | -u [username] -P [password:!])
-o [organization][-p [base path] -h [apigee API url] -i]
base path defaults to "/"
Apigee URL defaults to "https://api.enterprise.apigee.com"
-i denotes to import only and not actually deploy
Specifying -P ! will prompt for password
"""
sys.exit(1)

if PW == None:
UserPW = User
else:
UserPW = User + ':' + PW

url = urlparse.urlparse(ApigeeHost)
httpScheme = url[0]
httpHost = url[1]
Expand Down