rdkcentral / python_raft

RAFT is a Python based testing framework for writing engineering tests. It provides a modular, config driven, low level testing framework
Apache License 2.0
3 stars 1 forks source link

AttributeError: 'rack' object has no attribute 'config' when specifying rack in command line #84

Closed jamcoole closed 2 weeks ago

jamcoole commented 3 months ago

I am getting attribute errors when specifying rack in command line e.g.

python example_ssh.py --config ../configs/rack4_config.yml --debug <-- works python example_ssh.py --config ../configs/rack4_config.yml --rack rack4 --debug <-- doesn't work

Error: File "/home/jenkins/RAFT/python_raft/examples/code/example_ssh.py", line 128, in <module> TEST = FirstTest() File "/home/jenkins/RAFT/python_raft/examples/code/example_ssh.py", line 52, in __init__ super().__init__(testName='example_test', qcId='1') File "/home/jenkins/RAFT/python_raft/examples/code/../../framework/core/testControl.py", line 116, in __init__ rack = self.rackControl.getRackByName( rackName ) File "/home/jenkins/RAFT/python_raft/examples/code/../../framework/core/rackController.py", line 383, in getRackByName if ( element.config ["name"] == rackName ): AttributeError: 'rack' object has no attribute 'config'

sample config:

globalConfig: includes: deviceConfig: "../configs/rack4_device_config.yml" local: log: directory: "./logs" delimiter: "/"

rackConfig: rack4: name: "rack4" description: "example config at my desk" slot1: name: "slot1" devices:

I get similar errors specifying slotName

python example_ssh.py --config ../configs/rack4_config.yml --slotName slot1 --debug Traceback (most recent call last): File "/home/jenkins/RAFT/python_raft/examples/code/example_ssh.py", line 128, in <module> TEST = FirstTest() File "/home/jenkins/RAFT/python_raft/examples/code/example_ssh.py", line 52, in __init__ super().__init__(testName='example_test', qcId='1') File "/home/jenkins/RAFT/python_raft/examples/code/../../framework/core/testControl.py", line 126, in __init__ slot = rack.getSlotByName( slotName ) File "/home/jenkins/RAFT/python_raft/examples/code/../../framework/core/rackController.py", line 323, in getSlotByName for x in self.slots: AttributeError: 'rack' object has no attribute 'slots'

Ulrond commented 4 weeks ago

@TB-1993 needs resolving for next milestone

TB-1993 commented 2 weeks ago

This has now been fixed and will be released as part of version 1.1.2.