Skip to content

Commit

Permalink
fix: pnum bug
Browse files Browse the repository at this point in the history
  • Loading branch information
deploy committed Mar 22, 2019
1 parent b2b984f commit b53b677
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def add_host():
project = request.form.get('project', "null").strip()
hostname = request.form.get('hostname', "null").strip()
host = request.form.get('host', "null").strip()
variable1 = request.form.get('variable1', "null").strip()
variable1 = request.form.get('variable1', "1").strip()
variable2 = request.form.get('variable2', "null").strip()
variable3 = request.form.get('variable3', "null").strip()
variable4 = request.form.get('variable4', "null").strip()
Expand All @@ -628,6 +628,8 @@ def add_host():
ones1 = serverinfo.query.filter(serverinfo.project_name == project, serverinfo.ip == host).all()
if len(ones1) != 0:
raise Exception('ERROR: host exist.')
if variable1 == '':
variable1 = '1'

newserver = serverinfo(project, hostname, host, variable1, variable2, variable3, variable4, variable5, variable6, variable7, variable8, variable9)
db.session.add(newserver)
Expand Down Expand Up @@ -1200,7 +1202,7 @@ def expansion():
time.sleep(5)
if status != 'ok':
raise Exception('ERROR: expansion host %s ssh fail. %s' %(host, expansionInfo))
variable1 = ""
variable1 = "1"
variable2 = ""
variable3 = ""
variable4 = ""
Expand Down

0 comments on commit b53b677

Please sign in to comment.