summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Client/Frame.py8
-rw-r--r--src/lib/Bcfg2/Options.py17
2 files changed, 11 insertions, 14 deletions
diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py
index 508e3b616..2fb81d6ba 100644
--- a/src/lib/Bcfg2/Client/Frame.py
+++ b/src/lib/Bcfg2/Client/Frame.py
@@ -7,6 +7,7 @@ import logging
import sys
import time
import Bcfg2.Client.Tools
+from Bcfg2.Compat import input
def cmpent(ent1, ent2):
@@ -150,12 +151,7 @@ class Frame(object):
else:
iprompt = prompt % (entry.tag, entry.get('name'))
try:
- # py3k compatibility
- try:
- ans = raw_input(iprompt.encode(sys.stdout.encoding,
- 'replace'))
- except NameError:
- ans = input(iprompt)
+ ans = input(iprompt.encode(sys.stdout.encoding, 'replace'))
if ans in ['y', 'Y']:
ret.append(entry)
except EOFError:
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py
index 34f4b2bc6..6ac9cafb1 100644
--- a/src/lib/Bcfg2/Options.py
+++ b/src/lib/Bcfg2/Options.py
@@ -21,9 +21,9 @@ DEFAULT_INSTALL_PREFIX = '/usr'
class DefaultConfigParser(ConfigParser.ConfigParser):
- def __init__(self,*args,**kwargs):
+ def __init__(self, *args, **kwargs):
"""Make configuration options case sensitive"""
- ConfigParser.ConfigParser.__init__(self,*args,**kwargs)
+ ConfigParser.ConfigParser.__init__(self, *args, **kwargs)
self.optionxform = str
def get(self, section, option, **kwargs):
@@ -100,7 +100,7 @@ class Option(object):
rv.append("%s %s" % (self.cmd, self.odesc))
else:
rv.append("%s" % self.cmd)
-
+
if self.cf:
if self.cmd:
rv.append("; ")
@@ -175,9 +175,10 @@ class Option(object):
% (self.deprecated_cf[0], self.deprecated_cf[1],
self.cf[0], self.cf[1]))
return
- except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
+ except (ConfigParser.NoSectionError,
+ ConfigParser.NoOptionError):
pass
-
+
# Default value not cooked
self.value = self.default
@@ -907,8 +908,8 @@ DECRYPT = \
default=False,
cmd='--decrypt',
long_arg=True)
-DECRYPT_STDOUT = \
- Option('Decrypt the specified file to stdout',
+CRYPT_STDOUT = \
+ Option('Decrypt or encrypt the specified file to stdout',
default=False,
cmd='--stdout',
long_arg=True)
@@ -968,7 +969,7 @@ SERVER_COMMON_OPTIONS = dict(repo=SERVER_REPOSITORY,
CRYPT_OPTIONS = dict(encrypt=ENCRYPT,
decrypt=DECRYPT,
- decrypt_stdout=DECRYPT_STDOUT,
+ crypt_stdout=CRYPT_STDOUT,
passphrase=CRYPT_PASSPHRASE,
xpath=CRYPT_XPATH,
properties=CRYPT_PROPERTIES,