aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPavlos Ratis <dastergon@gentoo.org>2014-10-02 20:54:20 +0300
committerPavlos Ratis <dastergon@gentoo.org>2014-10-02 23:20:40 +0300
commit2071b98b26bb4b0857beeceddb5911058fd5e4b2 (patch)
treea667c2e2e73db1dde575f95dcd9f9ed592b973fc /bin
parentfix bug when no docstring is passed to an action (diff)
downloadgentoo-keys-2071b98b26bb4b0857beeceddb5911058fd5e4b2.tar.gz
gentoo-keys-2071b98b26bb4b0857beeceddb5911058fd5e4b2.tar.bz2
gentoo-keys-2071b98b26bb4b0857beeceddb5911058fd5e4b2.zip
remove try/except since it's unnecessary
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gkey-gen10
-rwxr-xr-xbin/gkey-ldap11
-rwxr-xr-xbin/gkeys11
3 files changed, 14 insertions, 18 deletions
diff --git a/bin/gkey-gen b/bin/gkey-gen
index 5b8ba10..e322f11 100755
--- a/bin/gkey-gen
+++ b/bin/gkey-gen
@@ -18,9 +18,12 @@
from __future__ import print_function
+from gkeygen.cli import Main
+
import os
import sys
+
# This block ensures that ^C interrupts are handled quietly.
try:
import signal
@@ -39,14 +42,9 @@ except KeyboardInterrupt:
print()
sys.exit(1)
-
-from gkeygen.cli import Main
-
root = None
-try:
+if 'ROOT' in os.environ:
root = os.environ['ROOT']
-except KeyError:
- pass
main = Main(root=root)
main()
diff --git a/bin/gkey-ldap b/bin/gkey-ldap
index c40bd48..3d23ac1 100755
--- a/bin/gkey-ldap
+++ b/bin/gkey-ldap
@@ -18,8 +18,12 @@
from __future__ import print_function
+from gkeyldap.cli import Main
+
import os
import sys
+
+
# This block ensures that ^C interrupts are handled quietly.
try:
import signal
@@ -38,14 +42,9 @@ except KeyboardInterrupt:
print()
sys.exit(1)
-
-from gkeyldap.cli import Main
-
root = None
-try:
+if 'ROOT' in os.environ:
root = os.environ['ROOT']
-except KeyError:
- pass
main = Main(root=root)
main()
diff --git a/bin/gkeys b/bin/gkeys
index 86f0dd4..dded32e 100755
--- a/bin/gkeys
+++ b/bin/gkeys
@@ -18,8 +18,12 @@
from __future__ import print_function
+from gkeys.cli import Main
+
import os
import sys
+
+
# This block ensures that ^C interrupts are handled quietly.
try:
import signal
@@ -38,14 +42,9 @@ except KeyboardInterrupt:
print()
sys.exit(1)
-
-from gkeys.cli import Main
-
root = None
-try:
+if 'ROOT' in os.environ:
root = os.environ['ROOT']
-except KeyError:
- pass
main = Main(root=root)
main()