-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1c8faa
commit e022257
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# SwapManager | ||
# | ||
# Copyright (c) 2012 Daniel Berenguer <[email protected]> | ||
# Copyright (c) 2016 Daniel Berenguer <[email protected]> | ||
# | ||
# This file is part of the lagarto project. | ||
# | ||
|
@@ -153,6 +153,12 @@ def get_status(self, endpoints): | |
status.append(endp.dumps()) | ||
else: | ||
for item in endpoints: | ||
if "id" not in item: | ||
item["id"] = None | ||
if "location" not in item: | ||
item["location"] = None | ||
if "name" not in item: | ||
item["name"] = None | ||
endp = self.get_endpoint(item["id"], item["location"], item["name"]) | ||
if endp is not None: | ||
status.append(endp.dumps()) | ||
|
@@ -171,6 +177,11 @@ def set_status(self, endpoints): | |
""" | ||
status = [] | ||
for item in endpoints: | ||
if "id" not in item: | ||
item["id"] = None | ||
elif "location" not in item or "name" not in item: | ||
item["location"] = None | ||
item["name"] = None | ||
endp = self.get_endpoint(item["id"], item["location"], item["name"]) | ||
if endp is not None: | ||
if "value" in item: | ||
|