Skip to content

Commit

Permalink
Merge pull request #228 from ecoen66/master
Browse files Browse the repository at this point in the history
Support for DNACs, CNR and ancient firmware
  • Loading branch information
vvb authored Dec 13, 2023
2 parents 5cac1a2 + 539e938 commit 14ea3f2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions imcsdk/imcsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def _validate_connection(self):
return False

def _validate_model(self, model):
valid_model_prefixes = ["UCSC", "UCS-E", "UCSS", "HX", "APIC-SERVER-"]
valid_model_prefixes = ["UCSC", "UCS-E", "UCSS", "HX", "APIC-SERVER-", "DN1", "DN2", "DN3"]
valid_models = ["R460-4640810", "C260-BASE-2646"]

if model in valid_models:
Expand Down Expand Up @@ -541,8 +541,11 @@ def _update_version(self, response=None):
if response.error_code != 0:
raise ImcException(response.error_code,
response.error_descr)
firmware = response.out_config.child[0]
self._set_version(firmware.version)
if len(response.out_config.child) > 0:
firmware = response.out_config.child[0]
self._set_version(firmware.version)
else:
self._set_version("ancient")

def _update_domain_name_and_ip(self):
from .imcmethodfactory import config_resolve_dn
Expand Down

0 comments on commit 14ea3f2

Please sign in to comment.