Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
New version 1.2 with a new way to report messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcoandrade committed Jan 11, 2016
1 parent 20d9d90 commit c8c5d97
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
31 changes: 19 additions & 12 deletions CGI/configurecluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ def updateScript(name, masterdb, slavedb, masterhost, slavehost, masterport, sla
script.write(newData)
script.close()

def runProcess(cmd_list):
for cmd in cmd_list:
args = cmd.split()
p = subprocess.Popen(args, stdout=subprocess.PIPE)
out, err = p.communicate()
print out, err
def runProcess(cmd):
args = cmd.split()
p = subprocess.Popen(args, stdout=subprocess.PIPE)
out, err = p.communicate()
rc = p.returncode
return rc, out, err

def runCall(cmd):
subprocess.call(cmd, shell=True)
Expand All @@ -145,9 +145,16 @@ def message(msg):
updateScript('slony_subscribe.sh', masterdb, slavedb, masterhost, slavehost, masterport, slaveport, masteruser, masterpass, slaveuser, slavepass, clustername)

# Configuring slony and subscribing
cmd_list = []
cmd_list.append('sh slony_temp.sh')
runProcess(cmd_list)

msg = 'Cluster %s configurado com sucesso!' % clustername
message(msg)
cmd = 'sh slony_temp.sh'
rc, out, err = runProcess(cmd)
if rc == 0:
msg = 'Cluster %s configurado com sucesso!' % clustername
message(msg)
else:
msg = 'Problema na criação do Cluster %s!' % clustername
if out:
msg += '\n Saída: %s' % str(out)
if err:
msg += '\n Erro: %s' % str(err)
message(msg)

3 changes: 2 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
name=DsgManagementTools
qgisMinimumVersion=2.6
description=Tools to manage DSG's cartographic production
version=1.1.5
version=1.2
author=Brazilian Army - Geographic Service Bureau
[email protected]
about=
Expand All @@ -30,6 +30,7 @@ about=
1.1.3- Bug fix on get running daemons function
1.1.4- Update to work with server without stored password
1.1.5- Bug fix on servers without password
1.2- New way to report messages. Now critical information it's being passed to the user.

# Tags are comma separated with spaces allowed
tags=
Expand Down

0 comments on commit c8c5d97

Please sign in to comment.