diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2016-09-13 16:11:47 +0100 |
---|---|---|
committer | usd-importer <ubuntu-server@lists.ubuntu.com> | 2016-09-14 10:39:12 +0000 |
commit | 4a992af5bc223c74489ce6a4f965adffb0b627c7 (patch) | |
tree | c2369bef3cbd9c76ca629d4cae5f371087b98ee8 /tests/data/ext/sample_ext/sample.py | |
parent | b0cb938c8bd00066ae0f3cdb9ecf0b1d7f2ca57e (diff) | |
parent | a4695e009df8ae6db98497d92216db4ed4e344a1 (diff) | |
download | vyos-walinuxagent-4a992af5bc223c74489ce6a4f965adffb0b627c7.tar.gz vyos-walinuxagent-4a992af5bc223c74489ce6a4f965adffb0b627c7.zip |
Import patches-applied version 2.1.5-0ubuntu1 to applied/ubuntu/yakkety-proposed
Imported using git-ubuntu import.
Changelog parent: b0cb938c8bd00066ae0f3cdb9ecf0b1d7f2ca57e
Unapplied parent: a4695e009df8ae6db98497d92216db4ed4e344a1
New changelog entries:
* New upstream release (LP: #1603581)
- d/patches/disable-auto-update.patch:
- The new version introduces auto-updating of the agent to its latest
version via an internal mechanism; disable this
- d/patches/fix_shebangs.patch:
- Dropped in favour of the dh_python3 --shebang option.
- Refreshed d/patches/disable_udev_overrides.patch
Diffstat (limited to 'tests/data/ext/sample_ext/sample.py')
-rwxr-xr-x | tests/data/ext/sample_ext/sample.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/data/ext/sample_ext/sample.py b/tests/data/ext/sample_ext/sample.py index 7107ac2..74bd839 100755 --- a/tests/data/ext/sample_ext/sample.py +++ b/tests/data/ext/sample_ext/sample.py @@ -2,18 +2,19 @@ import os + def get_seq(): - latest_seq = -1; + latest_seq = -1 config_dir = os.path.join(os.getcwd(), "config") if os.path.isdir(config_dir): for item in os.listdir(config_dir): item_path = os.path.join(config_dir, item) if os.path.isfile(item_path): - seperator = item.rfind(".") - if seperator > 0 and item[seperator + 1:] == "settings": - seq = int(item[0: seperator]) - if seq > latest_seq: - latest_seq = seq + separator = item.rfind(".") + if separator > 0 and item[separator + 1:] == "settings": + sequence = int(item[0: separator]) + if sequence > latest_seq: + latest_seq = sequence return latest_seq @@ -28,6 +29,9 @@ succeed_status = """ if __name__ == "__main__": seq = get_seq() if seq >= 0: - status_file = os.path.join(os.getcwd(), "status", "{0}.status".format(seq)) + status_path = os.path.join(os.getcwd(), "status") + if not os.path.exists(status_path): + os.makedirs(status_path) + status_file = os.path.join(status_path, "{0}.status".format(seq)) with open(status_file, "w+") as status: status.write(succeed_status) |