diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-11-13 20:19:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-13 20:19:54 +0100 |
commit | 225f22b9d5dfd0d1582a56530142fe8ffb960a91 (patch) | |
tree | 4dcc994bb1e48602e5be5f42b7599abdc0cc7937 /vendor/github.com/godbus/dbus/object.go | |
parent | 15220af08ce2346686e54851a6d498ec573e950c (diff) | |
parent | 6003033adae775f1d725b05231a246a4462ae669 (diff) | |
download | podman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.tar.gz podman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.tar.bz2 podman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.zip |
Merge pull request #4506 from TomSweeneyRedHat/dev/tsweeney/bump_buildah1.11.5
Bump to Buildah v1.11.5
Diffstat (limited to 'vendor/github.com/godbus/dbus/object.go')
-rw-r--r-- | vendor/github.com/godbus/dbus/object.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/vendor/github.com/godbus/dbus/object.go b/vendor/github.com/godbus/dbus/object.go index f27ffe144..9309b9b40 100644 --- a/vendor/github.com/godbus/dbus/object.go +++ b/vendor/github.com/godbus/dbus/object.go @@ -16,6 +16,7 @@ type BusObject interface { AddMatchSignal(iface, member string, options ...MatchOption) *Call RemoveMatchSignal(iface, member string, options ...MatchOption) *Call GetProperty(p string) (Variant, error) + SetProperty(p string, v interface{}) error Destination() string Path() ObjectPath } @@ -146,7 +147,7 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch } if msg.Flags&FlagNoReplyExpected == 0 { if ch == nil { - ch = make(chan *Call, 10) + ch = make(chan *Call, 1) } else if cap(ch) == 0 { panic("dbus: unbuffered channel passed to (*Object).Go") } @@ -187,7 +188,7 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch return call } -// GetProperty calls org.freedesktop.DBus.Properties.GetProperty on the given +// GetProperty calls org.freedesktop.DBus.Properties.Get on the given // object. The property name must be given in interface.member notation. func (o *Object) GetProperty(p string) (Variant, error) { idx := strings.LastIndex(p, ".") @@ -208,6 +209,20 @@ func (o *Object) GetProperty(p string) (Variant, error) { return result, nil } +// SetProperty calls org.freedesktop.DBus.Properties.Set on the given +// object. The property name must be given in interface.member notation. +func (o *Object) SetProperty(p string, v interface{}) error { + idx := strings.LastIndex(p, ".") + if idx == -1 || idx+1 == len(p) { + return errors.New("dbus: invalid property " + p) + } + + iface := p[:idx] + prop := p[idx+1:] + + return o.Call("org.freedesktop.DBus.Properties.Set", 0, iface, prop, v).Err +} + // Destination returns the destination that calls on (o *Object) are sent to. func (o *Object) Destination() string { return o.dest |