| 1 |
def provides_facts(): |
| 2 |
""" |
| 3 |
Returns a dictionary keyed on the facts provided by this module. The value |
| 4 |
of each key is the doc string describing the fact. |
| 5 |
""" |
| 6 |
return { |
| 7 |
"ifd_style": "The type of physical interface (ifd) supported by " |
| 8 |
"the device. Choices are 'CLASSIC' or 'SWITCH'.", |
| 9 |
} |
| 10 |
|
| 11 |
|
| 12 |
def get_facts(device): |
| 13 |
""" |
| 14 |
Determines ifd_style fact based on the personality. |
| 15 |
""" |
| 16 |
ifd_style = "CLASSIC" |
| 17 |
|
| 18 |
if device.facts["personality"] == "SWITCH": |
| 19 |
ifd_style = "SWITCH" |
| 20 |
elif device.facts["personality"] == "JDM": |
| 21 |
ifd_style = None |
| 22 |
|
| 23 |
return { |
| 24 |
"ifd_style": ifd_style, |
| 25 |
} |