summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rauwolf <rauwolf@itestra.de>2013-03-18 11:08:51 +0100
committerPhilip Rauwolf <rauwolf@itestra.de>2013-03-18 11:08:51 +0100
commitdf99ed4ecbfeb8e4f63ae49920ff2e603e756224 (patch)
treeec2fa74cd70e810e6ea19f6f564c03831406449b
parent1d6eb50e8cef6411ccca138475868030f68ecc72 (diff)
downloadgenivi-common-api-dbus-runtime-df99ed4ecbfeb8e4f63ae49920ff2e603e756224.tar.gz
Improved semantics of python fake legacy service
-rw-r--r--src/test/fakeLegacyService/sendToFakeLegacyService.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/test/fakeLegacyService/sendToFakeLegacyService.py b/src/test/fakeLegacyService/sendToFakeLegacyService.py
index ea23a74..79c1445 100644
--- a/src/test/fakeLegacyService/sendToFakeLegacyService.py
+++ b/src/test/fakeLegacyService/sendToFakeLegacyService.py
@@ -13,11 +13,21 @@ import dbus
import dbus.service
def finish():
- bus = dbus.SessionBus()
- remote_object = bus.get_object('fake.legacy.service.connection','/some/legacy/path/6259504')
- iface = dbus.Interface(remote_object, 'fake.legacy.service.LegacyInterface')
- iface.finish()
+ try:
+ bus = dbus.SessionBus()
+ remote_object = bus.get_object('fake.legacy.service.connection','/some/legacy/path/6259504')
+ iface = dbus.Interface(remote_object, 'fake.legacy.service.LegacyInterface')
+ iface.finish()
+ return 0
+ except:
+ print "Service not existing, therefore could not be stopped"
+ return 1
-command=sys.argv[1]
-if command=="finish":
- finish()
+def main():
+ command=sys.argv[1]
+ if command=="finish":
+ return finish()
+
+ return 0
+
+sys.exit(main()) \ No newline at end of file