vicc: use logging.critical if vicc needs exit()
This commit is contained in:
@@ -476,8 +476,8 @@ class VirtualICC(object):
|
||||
self.sock.settimeout(None)
|
||||
self.server_sock = None
|
||||
except socket.error as e:
|
||||
logging.error("Failed to open socket: %s", str(e))
|
||||
logging.error("Is pcscd running at %s? Is vpcd loaded? Is a \
|
||||
logging.critical("Failed to open socket: %s", str(e))
|
||||
logging.critical("Is pcscd running at %s? Is vpcd loaded? Is a \
|
||||
firewall blocking port %u?", host, port)
|
||||
sys.exit()
|
||||
else:
|
||||
@@ -498,8 +498,8 @@ class VirtualICC(object):
|
||||
(self.sock, self.server_sock, host) = self.openPort(port)
|
||||
self.sock.settimeout(None)
|
||||
except socket.error as e:
|
||||
logging.error("Failed to open socket: %s", str(e))
|
||||
logging.error("Is pcscd running? Is vpcd loaded and in \
|
||||
logging.critical("Failed to open socket: %s", str(e))
|
||||
logging.critical("Is pcscd running? Is vpcd loaded and in \
|
||||
reversed connection mode? Is a firewall \
|
||||
blocking port %u?", port)
|
||||
sys.exit()
|
||||
@@ -581,6 +581,7 @@ class VirtualICC(object):
|
||||
(self.sock, address) = self.server_sock.accept()
|
||||
continue
|
||||
else:
|
||||
logging.critical(str(e))
|
||||
sys.exit()
|
||||
|
||||
if not size:
|
||||
|
||||
@@ -41,7 +41,7 @@ class RelayOS(SmartcardOS):
|
||||
# See which readers are available
|
||||
readers = smartcard.System.listReaders()
|
||||
if len(readers) <= readernum:
|
||||
logging.error("Invalid number of reader '%u' (only %u available)",
|
||||
logging.critical("Invalid number of reader '%u' (only %u available)",
|
||||
readernum, len(readers))
|
||||
sys.exit()
|
||||
|
||||
@@ -53,7 +53,7 @@ class RelayOS(SmartcardOS):
|
||||
try:
|
||||
self.session = smartcard.Session(self.reader)
|
||||
except smartcard.Exceptions.CardConnectionException as e:
|
||||
logging.error("Error connecting to card: %s", e.message)
|
||||
logging.critical("Error connecting to card: %s", e.message)
|
||||
sys.exit()
|
||||
|
||||
logging.info("Connected to card in '%s'", self.reader)
|
||||
@@ -83,7 +83,7 @@ class RelayOS(SmartcardOS):
|
||||
self.session = smartcard.Session(self.reader)
|
||||
atr = self.session.getATR()
|
||||
except smartcard.Exceptions.CardConnectionException as e:
|
||||
logging.error("Error getting ATR: %s", e.message)
|
||||
logging.critical("Error getting ATR: %s", e.message)
|
||||
sys.exit()
|
||||
|
||||
return "".join([chr(b) for b in atr])
|
||||
@@ -99,7 +99,7 @@ class RelayOS(SmartcardOS):
|
||||
try:
|
||||
self.session = smartcard.Session(self.reader)
|
||||
except smartcard.Exceptions.CardConnectionException as e:
|
||||
logging.error("Error connecting to card: %s", e.message)
|
||||
logging.critical("Error connecting to card: %s", e.message)
|
||||
sys.exit()
|
||||
|
||||
def powerDown(self):
|
||||
@@ -108,7 +108,7 @@ class RelayOS(SmartcardOS):
|
||||
try:
|
||||
self.session.close()
|
||||
except smartcard.Exceptions.CardConnectionException as e:
|
||||
logging.error("Error disconnecting from card: %s", str(e))
|
||||
logging.critical("Error disconnecting from card: %s", str(e))
|
||||
sys.exit()
|
||||
|
||||
def reset(self):
|
||||
@@ -127,7 +127,7 @@ class RelayOS(SmartcardOS):
|
||||
try:
|
||||
rapdu, sw1, sw2 = self.session.sendCommandAPDU(apdu)
|
||||
except smartcard.Exceptions.CardConnectionException as e:
|
||||
logging.error("Error transmitting APDU: %s", str(e))
|
||||
logging.critical("Error transmitting APDU: %s", str(e))
|
||||
sys.exit()
|
||||
|
||||
# XXX this is a workaround, see on sourceforge bug #3083586
|
||||
|
||||
Reference in New Issue
Block a user