summaryrefslogtreecommitdiff
path: root/test/service-move-before
blob: d912c88bb2115f10cf39fc51c50894994a81fb69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python

import sys
import dbus

def print_usage():
	print "Usage: %s <service> <target service>" % (sys.argv[0])


if (len(sys.argv) < 2):
	print_usage()
	sys.exit(1)

bus = dbus.SystemBus()
path = "/net/connman/service/" + sys.argv[1]
service = dbus.Interface(bus.get_object('net.connman', path),
					'net.connman.Service')

path2 = "/net/connman/service/" + sys.argv[2]
service2 = dbus.Interface(bus.get_object('net.connman', path2),
					'net.connman.Service')

print "Moving %s before %s" % (sys.argv[1], sys.argv[2])

service.MoveBefore(service2)

print