-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add client-id subcommand to yggctl #259
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that it works, but I would improve error messages. Some functions do not have doc strings.
cmd/yggctl/actions.go
Outdated
@@ -173,6 +173,23 @@ func messageJournalAction(ctx *cli.Context) error { | |||
return nil | |||
} | |||
|
|||
func clientIDAction(ctx *cli.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc string for this function is missing
cmd/yggctl/actions.go
Outdated
obj := conn.Object("com.redhat.Yggdrasil1", "/com/redhat/Yggdrasil1") | ||
var clientID string | ||
if err := obj.Call("com.redhat.Yggdrasil1.GetClientID", dbus.Flags(0)).Store(&clientID); err != nil { | ||
return cli.Exit(fmt.Errorf("cannot retrieve client id: %v", err), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add more information to this error message. E.g. what object was called. Otherwise you get this error message:
user@localhost:~/path/to/yggdrasil$ go run ./cmd/yggctl client-id
cannot retrieve client id: The name is not activatable
exit status 1
|
Thanks for the initial review @jirihnidek . |
9f973ed
to
876aa11
Compare
dbus/com.redhat.Yggdrasil1.xml
Outdated
|
||
Returns the current client id on the interface. | ||
--> | ||
<method name="GetClientID"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try defining this as a D-Bus object property rather than a "getter" method?
876aa11
to
90b7818
Compare
This patch adds a 'client-id' subcommand to yggctl which retrieves and prints to stdout the active client ID of a yggd instance. This attempts to resolve issue RedHatInsights#243 Signed-off-by: Jason Jerome <[email protected]>
90b7818
to
9a45f83
Compare
This patch adds a 'client-id' subcommand
to yggctl which retrieves and prints to stdout
the active client ID of a yggd instance.
This attempts to resolve issue #243