open-traffic-generator / snappi-ixnetwork

The Keysight IxNetwork implementation of the open-traffic-generator models.
MIT License
17 stars 11 forks source link

Applying empty config does not clear the chassis/location object anymore #506

Open Rangababu-R opened 2 years ago

Rangababu-R commented 2 years ago

did some more testing and realized our script was clearing the config (applying an empty config) before checking the chassis properties. so the issue seems to be that clearing the config does not clear the chassis/location object anymore

    def enable_latency_stats(traffic_api: snappi.Api, config:snappi.snappi.Config):
        # if setup is not UHD, enable latency stats
        traffic_api.set_config(traffic_api.config())
        ixn_session = traffic_api.assistant.Session.Ixnetwork
        chassis = ixn_session.AvailableHardware.Chassis.find()
        try:
            chassis.href #only UHD has an empty session prepopulated with a chassis
        except:
            print("Enabling latency metrics")
            for flow in config.flows:
                flow.metrics.latency.enable = True

Originally posted by @dgalan-xxia in https://github.com/open-traffic-generator/snappi-ixnetwork/issues/496#issuecomment-1063487813

Rangababu-R commented 2 years ago

@dgalan-xxia Could you provide the UHD version of this issue seen.

dgalan-xxia commented 2 years ago

0.5.19

Rangababu-R commented 2 years ago

@dgalan-xxia not the snappi version UHD version is it 9.10 or 9.20?