Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
gplv2 committed May 15, 2018
1 parent 63511fe commit 7c056f7
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions create_haproxy_check.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python

import config
import os
import os, errno
import stat
import string
import sys
Expand Down Expand Up @@ -121,13 +121,24 @@ def main():
}

project = props["<%= @bn.project %>"]
os.mkdir('%s/%s' % (BASEDIR, project))
print("Creating haproxy project %s" % (project))
directory = ('%s/%s' % (BASEDIR, project))

if not os.path.isfile("template/%s.template" % sys.argv[1]):
print("Template does not exist : %s" % sys.argv[1])
sys.exit(0)

try:
print("Creating haproxy project %s" % (project))
os.makedirs(directory)
except OSError as e:
if e.errno != errno.EEXIST:
raise

new_haproxy_conf(props)
add_hba_checkuser(props)
add_hba_repmgr(props)

print("Done!")
print("Done!")

if __name__ == '__main__':
main()

0 comments on commit 7c056f7

Please sign in to comment.