Commit 80c0604
authored
Make the minigraph_facts module backward compatible (#2597)
What is the motivation for this PR?
The minigraph_facts module uses library sonic_py_common.multi_asic.get_namespace_list
to get the namespace list and store the value in variable namespace_list. On older SONiC
image, sonic_py_common.multi_asic is not available. Running this module will fail with
ImportError.
How did you do it?
This change improved this module to make it backward compatible with older SONiC
images by protecting sonic_py_common.multi_asic importing using try...except. When
ImportError is caught, just assign value [''] to variable namespace_list.
How did you verify/test it?
Test run the minigaph_facts module on image supports sonic_py_common.multi_asic and on
image does not support sonic_py_common.multi_asic.
Signed-off-by: Xin Wang <xiwang5@microsoft.com>1 parent 19a520b commit 80c0604
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
168 | | - | |
| 172 | + | |
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
| |||
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
182 | | - | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| |||
0 commit comments