Skip to content

Commit

Permalink
Merge pull request #1273 from jollyroger/debian-fixes-eight
Browse files Browse the repository at this point in the history
Debian fixes eight
  • Loading branch information
Mikhail Sobolev committed Oct 20, 2014
2 parents 5419a1e + 16b6d21 commit 45ef323
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
8 changes: 6 additions & 2 deletions master/buildbot/scripts/upgrade_master.py
Expand Up @@ -48,10 +48,14 @@ def checkBasedir(config):
tac = base.getConfigFromTac(config['basedir'])
if tac:
if isinstance(tac.get('rotateLength', 0), str):
print "WARNING: rotateLength is a string, it should be a number"
print "ERROR: rotateLength is a string, it should be a number"
print "ERROR: Please, edit your buildbot.tac file and run again"
print "ERROR: See http://trac.buildbot.net/ticket/2588 for more details"
return False
if isinstance(tac.get('maxRotatedFiles', 0), str):
print "WARNING: maxRotatedFiles is a string, it should be a number"
print "ERROR: maxRotatedFiles is a string, it should be a number"
print "ERROR: Please, edit your buildbot.tac file and run again"
print "ERROR: See http://trac.buildbot.net/ticket/2588 for more details"
return False

return True
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/test/unit/test_scripts_upgrade_master.py
Expand Up @@ -165,14 +165,14 @@ def test_checkBasedir_invalid_rotateLength(self):
self.activeBasedir(extra_lines=['rotateLength="32"'])
rv = upgrade_master.checkBasedir(mkconfig())
self.assertFalse(rv)
self.assertInStdout('WARNING')
self.assertInStdout('ERROR')
self.assertInStdout('rotateLength')

def test_checkBasedir_invalid_maxRotatedFiles(self):
self.activeBasedir(extra_lines=['maxRotatedFiles="64"'])
rv = upgrade_master.checkBasedir(mkconfig())
self.assertFalse(rv)
self.assertInStdout('WARNING')
self.assertInStdout('ERROR')
self.assertInStdout('maxRotatedFiles')

def test_loadConfig(self):
Expand Down
20 changes: 13 additions & 7 deletions master/contrib/init-scripts/buildmaster.init.sh
Expand Up @@ -117,15 +117,17 @@ function master_op () {

${MASTER_PREFIXCMD[$mi]} \
su -s /bin/sh \
-c "$MASTER_RUNNER $op --quiet ${MASTER_OPTIONS[$mi]} ${MASTER_BASEDIR[$mi]}" \
-c "$MASTER_RUNNER $op ${MASTER_OPTIONS[$mi]} ${MASTER_BASEDIR[$mi]} > /dev/null" \
- ${MASTER_USER[$mi]}
return $?
}

function do_op () {
errors=0
for i in $( seq ${#MASTER_ENABLED[@]} ); do
if is_disabled "${MASTER_ENABLED[$i]}" ; then
if [ -n "$4" ] && [ "$4" != "${MASTER_NAME[$i]}" ] ; then
continue
elif is_disabled "${MASTER_ENABLED[$i]}" && [ -z "$4" ] ; then
continue
fi

Expand All @@ -152,23 +154,27 @@ function do_op () {

case "$1" in
start)
do_op "master_op" "start" "Starting buildmaster"
do_op "master_op" "start" "Starting buildmaster" "$2"
exit $?
;;
stop)
do_op "master_op" "stop" "Stopping buildmaster"
do_op "master_op" "stop" "Stopping buildmaster" "$2"
exit $?
;;
reload)
do_op "master_op" "reconfig" "Reloading buildmaster"
do_op "master_op" "reconfig" "Reloading buildmaster" "$2"
exit $?
;;
restart|force-reload)
do_op "master_op" "restart" "Restarting buildmaster"
do_op "master_op" "restart" "Restarting buildmaster" "$2"
exit $?
;;
upgrade)
do_op "master_op" "upgrade-master" "Upgrading buildmaster" "$2"
exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
echo "Usage: $0 {start|stop|restart|reload|force-reload|upgrade}"
exit 1
;;
esac
Expand Down
14 changes: 8 additions & 6 deletions slave/contrib/init-scripts/buildslave.init.sh
Expand Up @@ -150,14 +150,16 @@ function slave_op () {
fi
${SLAVE_PREFIXCMD[$mi]} \
su $suopt - ${SLAVE_USER[$mi]} \
-c "$SLAVE_RUNNER $op --quiet ${SLAVE_OPTIONS[$mi]} ${SLAVE_BASEDIR[$mi]}"
-c "$SLAVE_RUNNER $op ${SLAVE_OPTIONS[$mi]} ${SLAVE_BASEDIR[$mi]} > /dev/null"
return $?
}

function do_op () {
errors=0
for i in $( seq ${#SLAVE_ENABLED[@]} ); do
if is_disabled "${SLAVE_ENABLED[$i]}" ; then
if [ -n "$4" ] && [ "$4" != "${SLAVE_NAME[$i]}" ] ; then
continue
elif is_disabled "${SLAVE_ENABLED[$i]}" && [ -z "$4" ] ; then
continue
fi

Expand All @@ -184,19 +186,19 @@ function do_op () {

case "$1" in
start)
do_op "slave_op" "start" "Starting buildslave"
do_op "slave_op" "start" "Starting buildslave" "$2"
exit $?
;;
stop)
do_op "slave_op" "stop" "Stopping buildslave"
do_op "slave_op" "stop" "Stopping buildslave" "$2"
exit $?
;;
reload)
do_op "slave_op" "reload" "Reloading buildslave"
do_op "slave_op" "reload" "Reloading buildslave" "$2"
exit $?
;;
restart|force-reload)
do_op "slave_op" "restart" "Restarting buildslave"
do_op "slave_op" "restart" "Restarting buildslave" "$2"
exit $?
;;
*)
Expand Down

0 comments on commit 45ef323

Please sign in to comment.