mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-09-03 20:52:56 -05:00
Clean up additional issues discovered with pylint and pychecker
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user