Merge branch 'release_2.3' into devel

* release_2.3: (54 commits)
  Upgrade changelog for 2.3
  Purge superlance
  Purge an old supervisor config
  Require chris-lea libzmq3
  Use the htpasswd command, not the module
  Fix a playbook syntax error for postgres
  Ensure postgres is started earlier in setup role
  Allow customizing npm path
  Include RPM-GPG-KEY-ansible-release for all releases
  Simplify GPG keys
  Correct broken RPM-GPG-KEY
  Use gpg --passphrase for signing CHECKSUM
  Handle rpm --addsign pasphrase prompts
  Adding docker-compose development workflow
  Fix license in spec file.
  Updates to selinux policy for some munin plugins
  ansible 1.8.4 requires sudo:true when using sudo_user
  Fix expect script timeout
  Disable timeout and correct sign.exp error
  Fix expect script hang
  ...
This commit is contained in:
Matthew Jones
2015-09-11 16:03:52 -04:00
6 changed files with 152 additions and 64 deletions

49
tools/scripts/sign.exp Executable file
View File

@@ -0,0 +1,49 @@
#!/usr/bin/expect -f
#
# Helper script to respond to passphrase prompts from the gpg command.
#
# Disable timeout
set timeout -1
# Optionally print usage message
if {[llength $argv] <= 0} {
puts "Usage: sign.exp <command>"
exit 1
}
# Process arguments
set command [join $argv]
if { [info exists env(PASSPHRASE) ] } {
set passphrase $env(PASSPHRASE)
} else {
set passphrase ""
}
# Run the desired command
spawn {*}$command
expect {
-nocase "enter passphrase:" {
send -- "$passphrase\r"
exp_continue
}
-nocase "enter pass phrase:" {
send -- "$passphrase\r"
exp_continue
}
timeout {
puts "expect timeout"
exit 1
}
eof { }
}
lassign [wait] pid spawnid os_error_flag retval
if {$os_error_flag == 0} {
puts "exit status: $retval"
} else {
puts "errno: $retval"
}
exit $retval