Skip to content
Snippets Groups Projects
Commit 589da111 authored by juga's avatar juga Committed by Matt Traudt
Browse files

Fix mispelled latest

parent aa1dd5ad
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ KEYVALUE_SEP_V200 = ' '
EXTRA_ARG_KEYVALUES = ['software', 'software_version', 'file_created',
'earliest_bandwidth', 'generator_started']
# List of all unordered KeyValues currently being used to generate the file
UNORDERED_KEYVALUES = EXTRA_ARG_KEYVALUES + ['lastest_bandwidth']
UNORDERED_KEYVALUES = EXTRA_ARG_KEYVALUES + ['latest_bandwidth']
# List of all the KeyValues currently being used to generate the file
ALL_KEYVALUES = ['version'] + UNORDERED_KEYVALUES
TERMINATOR = '===='
......@@ -71,9 +71,9 @@ class V3BwHeader(object):
self.software = kwargs.get('software', 'sbws')
self.software_version = kwargs.get('software_version', __version__)
self.file_created = kwargs.get('file_created', now_isodt_str())
# lastest_bandwidth should not be in kwargs, since it MUST be the
# latest_bandwidth should not be in kwargs, since it MUST be the
# same as timestamp
self.lastest_bandwidth = unixts_to_isodt_str(timestamp)
self.latest_bandwidth = unixts_to_isodt_str(timestamp)
[setattr(self, k, v) for k, v in kwargs.items()
if k in EXTRA_ARG_KEYVALUES]
......@@ -167,7 +167,7 @@ class V3BwHeader(object):
return read_started_ts(conf)
@staticmethod
def lastest_bandwidth_from_results(results):
def latest_bandwidth_from_results(results):
return round(max([r.time for fp in results for r in results[fp]]))
@staticmethod
......@@ -177,11 +177,11 @@ class V3BwHeader(object):
@classmethod
def from_results(cls, conf, results):
kwargs = dict()
lastest_bandwidth = cls.lastest_bandwidth_from_results(results)
earliest_bandwidth = cls.lastest_bandwidth_from_results(results)
latest_bandwidth = cls.latest_bandwidth_from_results(results)
earliest_bandwidth = cls.latest_bandwidth_from_results(results)
generator_started = cls.generator_started_from_file(conf)
timestamp = str(lastest_bandwidth)
kwargs['lastest_bandwidth'] = unixts_to_isodt_str(lastest_bandwidth)
timestamp = str(latest_bandwidth)
kwargs['latest_bandwidth'] = unixts_to_isodt_str(latest_bandwidth)
kwargs['earliest_bandwidth'] = unixts_to_isodt_str(earliest_bandwidth)
kwargs['generator_started'] = generator_started
h = cls(timestamp, **kwargs)
......
......@@ -11,10 +11,10 @@ software_l = KEYVALUE_SEP_V110.join(['software', 'sbws'])
software_version_l = KEYVALUE_SEP_V110.join(['software_version', version])
file_created = '2018-04-25T13:10:57'
file_created_l = KEYVALUE_SEP_V110.join(['file_created', file_created])
lastest_bandwidth = '2018-04-17T14:09:07'
lastest_bandwidth_l = KEYVALUE_SEP_V110.join(['lastest_bandwidth',
lastest_bandwidth])
header_ls = [timestamp_l, version_l, file_created_l, lastest_bandwidth_l,
latest_bandwidth = '2018-04-17T14:09:07'
latest_bandwidth_l = KEYVALUE_SEP_V110.join(['latest_bandwidth',
latest_bandwidth])
header_ls = [timestamp_l, version_l, file_created_l, latest_bandwidth_l,
software_l, software_version_l, TERMINATOR]
header_str = LINE_SEP.join(header_ls) + LINE_SEP
earliest_bandwidth = '2018-04-16T14:09:07'
......@@ -25,7 +25,7 @@ generator_started_l = KEYVALUE_SEP_V110.join(['generator_started',
generator_started])
header_extra_ls = [timestamp_l, version_l,
earliest_bandwidth_l, file_created_l, generator_started_l,
lastest_bandwidth_l,
latest_bandwidth_l,
software_l, software_version_l, TERMINATOR]
header_extra_str = LINE_SEP.join(header_extra_ls) + LINE_SEP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment