Skip to content

Commit 8beb5cb

Browse files
Bastian-KrauseEmantor
authored andcommitted
remote/client: print full resource identifier on monitor
`labgrid-client monitor` prints resources as `<exporter>/<group>/<name>`, while the resource match pattern has the format `<exporter>/<group>/<class>/<name>`. The `/<name>` is optional. So in `labgrid-client monitor`, the class name is missing. This is confusing. Resource match patterns cannot be copy/pasted into `labgrid-client add-match` or `labgrid-client add-named-match`. Fix that by printing the full resource identifier for the monitor subcommand. Signed-off-by: Bastian Krause <bst@pengutronix.de> (cherry picked from commit f9d4ccd) Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
1 parent bd06df0 commit 8beb5cb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

labgrid/remote/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ async def on_resource_changed(self, exporter, group_name, resource_name, resourc
116116
group[resource_name].data = resource
117117
if self.monitor:
118118
if resource and not old:
119-
print(f"Resource {exporter}/{group_name}/{resource_name} created: {resource}")
119+
print(f"Resource {exporter}/{group_name}/{resource['cls']}/{resource_name} created: {resource}")
120120
elif resource and old:
121-
print(f"Resource {exporter}/{group_name}/{resource_name} changed:")
121+
print(f"Resource {exporter}/{group_name}/{resource['cls']}/{resource_name} changed:")
122122
for k, v_old, v_new in diff_dict(flat_dict(old), flat_dict(resource)):
123123
print(f" {k}: {v_old} -> {v_new}")
124124
else:
125-
print(f"Resource {exporter}/{group_name}/{resource_name} deleted")
125+
print(f"Resource {exporter}/{group_name}/{resource['cls']}/{resource_name} deleted")
126126

127127
async def on_place_changed(self, name, config):
128128
if not config:

0 commit comments

Comments
 (0)