SEBA-664 Allow ONU to be manually disabled
Change-Id: Ib23d16eca9a0a9b6c4315791e285f6e52e858e8a
diff --git a/xos/synchronizer/steps/sync_onu_device.py b/xos/synchronizer/steps/sync_onu_device.py
index 004aa09..ce63ec8 100644
--- a/xos/synchronizer/steps/sync_onu_device.py
+++ b/xos/synchronizer/steps/sync_onu_device.py
@@ -53,7 +53,7 @@
def sync_record(self, o):
- if o.admin_state == "DISABLED":
+ if o.admin_state in ["DISABLED", "ADMIN_DISABLED"]:
self.disable_onu(o)
if o.admin_state == "ENABLED":
self.enable_onu(o)
\ No newline at end of file
diff --git a/xos/synchronizer/steps/test_sync_onu_device.py b/xos/synchronizer/steps/test_sync_onu_device.py
index 612b44f..aba57aa 100644
--- a/xos/synchronizer/steps/test_sync_onu_device.py
+++ b/xos/synchronizer/steps/test_sync_onu_device.py
@@ -82,6 +82,14 @@
self.assertTrue(m.called)
@requests_mock.Mocker()
+ def test_admin_disabled(self, m):
+ m.post("http://voltha_url:1234/api/v1/devices/test_id/disable")
+
+ self.o.admin_state = "ADMIN_DISABLED"
+ self.sync_step(model_accessor=self.model_accessor).sync_record(self.o)
+ self.assertTrue(m.called)
+
+ @requests_mock.Mocker()
def test_disable_fail(self, m):
m.post("http://voltha_url:1234/api/v1/devices/test_id/disable", status_code=500, text="Mock Error")