From 3a901b963ff7e5d56f65a3581563835da6765202 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Tue, 16 Oct 2018 16:49:54 +0800 Subject: Ignore owner_id JIRA: - Support add machine without owner_id Change-Id: Ia47d6c4cd514ee315350b45eaa64282e15f97346 Signed-off-by: Harry Huang --- compass-deck/db/api/machine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compass-deck') diff --git a/compass-deck/db/api/machine.py b/compass-deck/db/api/machine.py index 7991ada..4222288 100644 --- a/compass-deck/db/api/machine.py +++ b/compass-deck/db/api/machine.py @@ -68,7 +68,7 @@ def _get_machine(machine_id, session=None, **kwargs): @utils.input_validates(mac=utils.check_mac) def _add_machine(mac, owner_id=None, session=None, **kwargs): """Add a machine.""" - if isinstance(owner_id, (int, long)): + if not owner_id or isinstance(owner_id, (int, long)): return utils.add_db_object( session, models.Machine, True, -- cgit 1.2.3-korg