Anand Doshi | 0a4d1e3 | 2012-05-26 15:17:38 +0530 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | import commands |
| 3 | |
| 4 | cmd_list = [ |
| 5 | 'lib/wnf.py --pull origin master', |
| 6 | 'lib/wnf.py -l', |
| 7 | 'lib/wnf.py --sync_all' |
| 8 | ] |
Anand Doshi | 652410b | 2012-05-26 15:28:28 +0530 | [diff] [blame] | 9 | err = 0 |
Anand Doshi | 0a4d1e3 | 2012-05-26 15:17:38 +0530 | [diff] [blame] | 10 | for cmd in cmd_list: |
| 11 | stat, op = commands.getstatusoutput(cmd) |
| 12 | if stat != 0: |
| 13 | print "something went wrong" |
| 14 | print "cannot proceed with update" |
| 15 | print "status: %s" % stat |
| 16 | print "output: %s" % op |
Anand Doshi | 652410b | 2012-05-26 15:28:28 +0530 | [diff] [blame] | 17 | err = 1 |
Anand Doshi | 1c9913a | 2012-05-26 15:27:28 +0530 | [diff] [blame] | 18 | break |
| 19 | |
Anand Doshi | 652410b | 2012-05-26 15:28:28 +0530 | [diff] [blame] | 20 | if not err: |
| 21 | print "update_erpnext.py --> run success." |
| 22 | else: |
| 23 | print "update_erpnext.py --> run failed." |