Compare commits
No commits in common. "a11629f543a8b43451cecc46600a78cbb6af015a" and "421cc06d6c35dbe5bd6343b3c0cc8609a1de9c9d" have entirely different histories.
a11629f543
...
421cc06d6c
@ -6,7 +6,7 @@ import time
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from . import OMMClient2
|
from . import OMMClient2
|
||||||
from .exceptions import EAuth, ENoEnt
|
from .exceptions import ENoEnt
|
||||||
from .messages import GetAccount, Ping
|
from .messages import GetAccount, Ping
|
||||||
|
|
||||||
# exit handling with argparse is a bit broken even with exit_on_error=False, so we hack this
|
# exit handling with argparse is a bit broken even with exit_on_error=False, so we hack this
|
||||||
@ -40,14 +40,7 @@ def main():
|
|||||||
if not password:
|
if not password:
|
||||||
password = getpass.getpass(prompt="OMM password for {}@{}:".format(username, hostname))
|
password = getpass.getpass(prompt="OMM password for {}@{}:".format(username, hostname))
|
||||||
|
|
||||||
try:
|
|
||||||
c = OMMClient2(hostname, username, password, ommsync=ommsync)
|
c = OMMClient2(hostname, username, password, ommsync=ommsync)
|
||||||
except EAuth:
|
|
||||||
print("Authentication failed")
|
|
||||||
exit(1)
|
|
||||||
except TimeoutError:
|
|
||||||
print("OMM unreachable")
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(prog="ommclient2", add_help=False, exit_on_error=False)
|
parser = argparse.ArgumentParser(prog="ommclient2", add_help=False, exit_on_error=False)
|
||||||
subparsers = parser.add_subparsers()
|
subparsers = parser.add_subparsers()
|
||||||
|
@ -26,7 +26,6 @@ class Connection:
|
|||||||
self._host = host
|
self._host = host
|
||||||
self._port = port
|
self._port = port
|
||||||
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
self._socket.settimeout(2)
|
|
||||||
|
|
||||||
self._seq = 0 # state of the sequence number generator
|
self._seq = 0 # state of the sequence number generator
|
||||||
self._requests = {} # waiting area for pending responses
|
self._requests = {} # waiting area for pending responses
|
||||||
|
Loading…
Reference in New Issue
Block a user