BackupGGCode / roster-dns-management

DNS Management system.
0 stars 2 forks source link

suggest trap signals from User Tools #358

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

When I write a shellscript (below) to list all hosts for all zones, e.g., and I 
send a keyboard INTR signal to my script, the current python command throws an 
error for the Interrupt and an error for the Broken Pipe (parent script 
terminated), exiting rather messily.  It would be desirable to trap signals to 
make scripting easier and to to verify proper cleanup.

What is the expected output? What do you see instead?

Script exits quietly, or elegantly, if a python message or return code is 
deemed appropriate. 

What version of the product are you using? On what operating system?

$ dnslszone --version
dnslszone (Roster #TRUNK#)

OS is RHEL 6.0 (2.6.32-220.13.1.el6.x86_64)

Please provide any additional information below.

Example shellscript code:

#/bin/ksh
prevzone=""

dnslszone all | while read ZONE line
do
  if [ $? != 0 ] ; then
       echo dnslszone terminated with $?
       exec exit
  fi
  if [ -n "$ZONE" -a "$ZONE" != "zone_name" -a "$ZONE" != "--------------------------------------------------------------------------------" -a "$ZONE" != "$prevzone" ] ; then
    dnslshost zone -z $ZONE --no-header
    if [ $? != 0 ] ; then
       echo dnslshost terminated with $?
       exec exit
    fi
    prevzone=$ZONE
  fi
done

Original issue reported on code.google.com by lsar...@gmail.com on 22 Jan 2013 at 9:16

GoogleCodeExporter commented 9 years ago

Original comment by sharrell...@gmail.com on 22 Jan 2013 at 9:18