Skip to content

Commit 5f76295

Browse files
committed
fix(device): fixes the device inspect command
Signed-off-by: Ankit R Gadiya <[email protected]>
1 parent 4607022 commit 5f76295

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

riocli/device/inspect.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import click
15-
import typing
1615
from rapyuta_io.clients import Device
1716

1817
from riocli.config import new_client
@@ -39,18 +38,10 @@ def inspect_device(format_type: str, device_name: str, device_guid: str) -> None
3938

4039

4140
def make_device_inspectable(device: Device) -> dict:
42-
blacklist_attr = ['deviceId', 'config_variables']
43-
device_data = remove_non_inspecting_attributes(device, blacklist_attr)
44-
return device_data
41+
data = {}
42+
for key, val in device.items():
43+
if key.startswith('_') or key in ['deviceId']:
44+
continue
45+
data[key] = val
4546

46-
47-
def remove_non_inspecting_attributes(device: Device, blacklist: typing.List[str]) -> dict:
48-
device_response = dict(device)
49-
for key in device_response.keys():
50-
if key.startswith('_') or key in blacklist:
51-
if key == 'config_variables':
52-
for config_var in device_response['config_variables']:
53-
config_var.pop('id')
54-
else:
55-
device_response.pop(key)
56-
return device_response
47+
return data

0 commit comments

Comments
 (0)