summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-08-13 09:27:13 -0400
committerRob Crittenden <rcritten@redhat.com>2009-08-20 09:20:56 -0400
commitd9c54cd83e8c676e34497fa135786a626d5d1fc7 (patch)
tree9f0b4defe1bbc50d96cfedabf5d2b591de8eac53 /ipapython
parent8780751330871033b13fc8fbb7eb0588baf4417d (diff)
downloadfreeipa-d9c54cd83e8c676e34497fa135786a626d5d1fc7.tar.gz
freeipa-d9c54cd83e8c676e34497fa135786a626d5d1fc7.tar.xz
freeipa-d9c54cd83e8c676e34497fa135786a626d5d1fc7.zip
Clean up additional issues discovered with pylint and pychecker
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipasslfile.py4
-rw-r--r--ipapython/ipautil.py10
-rw-r--r--ipapython/test/test_ipautil.py8
3 files changed, 7 insertions, 15 deletions
diff --git a/ipapython/ipasslfile.py b/ipapython/ipasslfile.py
index 5f4ea2a7..2082e268 100644
--- a/ipapython/ipasslfile.py
+++ b/ipapython/ipasslfile.py
@@ -17,7 +17,9 @@
import socket
import errno
-from httplib import UnimplementedFileMode
+from httplib import UnimplementedFileMode, HTTPException
+
+error = HTTPException
class SharedSocket:
def __init__(self, sock):
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 2fa26fef..240e0d87 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -600,16 +600,6 @@ def user_input_plain(prompt, default = None, allow_empty = True, allow_spaces =
if ipavalidate.Plain(ret, not allow_empty, allow_spaces):
return ret
-def user_input_path(prompt, default = None, allow_empty = True):
- if default != None and allow_empty:
- prompt += " (enter \"none\" for empty)"
- while True:
- ret = user_input(prompt, default, allow_empty)
- if allow_empty and ret.lower() == "none":
- return ""
- if ipavalidate.Path(ret, not allow_empty):
- return ret
-
class AttributeValueCompleter:
'''
Gets input from the user in the form "lhs operator rhs"
diff --git a/ipapython/test/test_ipautil.py b/ipapython/test/test_ipautil.py
index 7df8e99a..98e8846c 100644
--- a/ipapython/test/test_ipautil.py
+++ b/ipapython/test/test_ipautil.py
@@ -275,7 +275,7 @@ class TestTimeParser(unittest.TestCase):
time = ipautil.parse_generalized_time(timestr)
self.assertEqual(0, time.tzinfo.houroffset)
self.assertEqual(0, time.tzinfo.minoffset)
- offset = time.tzinfo.utcoffset(None)
+ offset = time.tzinfo.utcoffset()
self.assertEqual(0, offset.seconds)
timestr = "20051213141205+0500"
@@ -283,7 +283,7 @@ class TestTimeParser(unittest.TestCase):
time = ipautil.parse_generalized_time(timestr)
self.assertEqual(5, time.tzinfo.houroffset)
self.assertEqual(0, time.tzinfo.minoffset)
- offset = time.tzinfo.utcoffset(None)
+ offset = time.tzinfo.utcoffset()
self.assertEqual(5 * 60 * 60, offset.seconds)
timestr = "20051213141205-0500"
@@ -293,7 +293,7 @@ class TestTimeParser(unittest.TestCase):
self.assertEqual(0, time.tzinfo.minoffset)
# NOTE - the offset is always positive - it's minutes
# _east_ of UTC
- offset = time.tzinfo.utcoffset(None)
+ offset = time.tzinfo.utcoffset()
self.assertEqual((24 - 5) * 60 * 60, offset.seconds)
timestr = "20051213141205-0930"
@@ -301,7 +301,7 @@ class TestTimeParser(unittest.TestCase):
time = ipautil.parse_generalized_time(timestr)
self.assertEqual(-9, time.tzinfo.houroffset)
self.assertEqual(-30, time.tzinfo.minoffset)
- offset = time.tzinfo.utcoffset(None)
+ offset = time.tzinfo.utcoffset()
self.assertEqual(((24 - 9) * 60 * 60) - (30 * 60), offset.seconds)