Browse Source

(fix) Support non-present networks

- Drydock should support defined networks that MAAS cannot
  see. This fixes an issue that caused this use-case to fail
  by ensuring that the MAAS client models with no internal
  resource IDs work.

Change-Id: I1a20d4730e94eee7268ff0cc3451e4b459a1e62b
changes/48/637948/1
Scott Hussey 3 months ago
parent
commit
7504c2f907

+ 1
- 1
python/drydock_provisioner/drivers/node/maasdriver/models/fabric.py View File

@@ -26,7 +26,7 @@ class Fabric(model_base.ResourceBase):
26 26
     def __init__(self, api_client, **kwargs):
27 27
         super(Fabric, self).__init__(api_client, **kwargs)
28 28
 
29
-        if hasattr(self, 'resource_id'):
29
+        if getattr(self, 'resource_id', None):
30 30
             self.refresh_vlans()
31 31
 
32 32
     def refresh(self):

+ 1
- 1
python/drydock_provisioner/drivers/node/maasdriver/models/machine.py View File

@@ -46,7 +46,7 @@ class Machine(model_base.ResourceBase):
46 46
         super(Machine, self).__init__(api_client, **kwargs)
47 47
 
48 48
         # Replace generic dicts with interface collection model
49
-        if hasattr(self, 'resource_id'):
49
+        if getattr(self, 'resource_id', None):
50 50
             self.interfaces = maas_interface.Interfaces(
51 51
                 api_client, system_id=self.resource_id)
52 52
             self.interfaces.refresh()

Loading…
Cancel
Save