From 12e8ccd01c62b8dab8f20cb8ff624c5d1d8aac1c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 14 Jan 2020 19:10:59 +0100 Subject: [PATCH] Cleanups for mac handling --- uncloud/hack/mac.py | 5 +---- uncloud/hack/main.py | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/uncloud/hack/mac.py b/uncloud/hack/mac.py index 4ac05f2..a408103 100755 --- a/uncloud/hack/mac.py +++ b/uncloud/hack/mac.py @@ -60,9 +60,6 @@ class MAC(object): return ':'.join(format(s, '02x') for s in b) def get_next(self, vmuuid=None, as_int=False): -# if self.free: -# return self.free.pop() - last_number = self.last_used_index() # FIXME: compare to 48bit minus prefix length @@ -81,7 +78,7 @@ class MAC(object): db_entry['mac_address'] = next_mac self.db.set("used/{}".format(next_mac), - db_entry) + db_entry, as_json=True) if as_int: return next_mac_number diff --git a/uncloud/hack/main.py b/uncloud/hack/main.py index ffd0374..2980516 100644 --- a/uncloud/hack/main.py +++ b/uncloud/hack/main.py @@ -25,5 +25,4 @@ def main(arguments): print(m.last_used_mac()) if arguments['get_new_mac']: - m = MAC(config).get_next() - print(m.last_used()) + print(MAC(config).get_next())