Skip to content

Commit

Permalink
67 name file is not defined is shown in some checks (#68)
Browse files Browse the repository at this point in the history
* file > open binary

* suppress futurewarning
  • Loading branch information
monrog2 authored Aug 14, 2023
1 parent 3196a0e commit 5254892
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from getpass import getpass
from collections import defaultdict
from datetime import datetime
import warnings
import time
import pexpect
import logging
Expand Down Expand Up @@ -52,6 +53,7 @@
fmt = '[%(asctime)s.%(msecs)03d{} %(levelname)-8s %(funcName)20s:%(lineno)-4d] %(message)s'.format(tz)
subprocess.check_output(['mkdir', '-p', DIR])
logging.basicConfig(level=logging.DEBUG, filename=LOG_FILE, format=fmt, datefmt='%Y-%m-%d %H:%M:%S')
warnings.simplefilter(action='ignore', category=FutureWarning)


class Connection(object):
Expand Down Expand Up @@ -139,7 +141,7 @@ def start_log(self):
# if self.log is a string, then attempt to open file pointer (do not catch exception, we want it
# to die if there's an error opening the logfile)
if isinstance(self.log, str) or isinstance(self.log, unicode):
self._log = file(self.log, "a")
self._log = open(self.log, "ab")
else:
self._log = self.log
logging.debug("setting logfile to %s" % self._log.name)
Expand Down

0 comments on commit 5254892

Please sign in to comment.