Skip to content

Commit

Permalink
ConfigParser values must be strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradley Evans committed Jul 23, 2019
1 parent 5d180e9 commit c3a5bf7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cfltools/logparse/test_logparse.py
Expand Up @@ -129,7 +129,7 @@ def dummy_asndb(tmpdir):
from cfltools.utilities import asn_update
from pyasn import pyasn
asn_datfile = asn_update(tmpdir)
yield pyasn(asn_datfile)
yield pyasn(str(asn_datfile))


def test_open_file_and_checksum(logfile):
Expand Down
2 changes: 1 addition & 1 deletion cfltools/utilities/functions.py
Expand Up @@ -58,6 +58,6 @@ def asn_update(target=APPDIR):
logger.warning("Could not download ASN database.")
logger.warning("Instantiating a default DAT file. This may be very out of date!")
copyfile(UTILDIR/'default.dat', APPDIR/'default.dat')
newfile = APPDIR/'default.dat'
newfile = str(APPDIR/'default.dat')
logger.info("New ASN .dat file created at %s", newfile)
return newfile
2 changes: 2 additions & 0 deletions cfltools/utilities/objects.py
Expand Up @@ -99,6 +99,8 @@ def write(self, attr, newvalue):
Does not return.
"""
# parser.read(self.configfile)
if type(newvalue) is not str:
newvalue = str(newvalue)
self.parser['USER'][attr] = newvalue
with open(self.configfile, 'a') as file:
self.parser.write(file)
Expand Down

0 comments on commit c3a5bf7

Please sign in to comment.