Skip to content

Commit

Permalink
ros#610: rosgraph.xmlrpc.ServerProxy for roswtf
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrrx authored and jspricke committed Jan 31, 2017
1 parent b742bac commit 82bb411
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 2 additions & 5 deletions utilities/roswtf/src/roswtf/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,13 @@
import socket
import sys
import time
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

import rospkg.environment

import rosgraph
import rosgraph.rosenv
import rosgraph.network
import rosgraph.xmlrpc

import rosnode
import rosservice
Expand Down Expand Up @@ -291,7 +288,7 @@ def run(self):
ctx.errors.append(WtfError("Master does not have lookup information for node [%s]"%n))
return

node = ServerProxy(node_api)
node = rosgraph.xmlrpc.ServerProxy(node_api)
start = time.time()
socket.setdefaulttimeout(3.0)
code, msg, bus_info = node.getBusInfo('/roswtf')
Expand Down
13 changes: 5 additions & 8 deletions utilities/roswtf/src/roswtf/roslaunchwtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@
import socket
import stat
import sys
try:
from xmlrpc.client import ServerProxy
except ImportError:
from xmlrpclib import ServerProxy

from os.path import isfile, isdir

import rosgraph.xmlrpc
import roslib.packages
import roslaunch
import roslaunch.netapi
Expand Down Expand Up @@ -201,7 +198,7 @@ def roslaunch_respawn_check(ctx):
respawn = []
for uri in ctx.roslaunch_uris:
try:
r = ServerProxy(uri)
r = rosgraph.xmlrpc.ServerProxy(uri)
code, msg, val = r.list_processes()
active, _ = val
respawn.extend([a for a in active if a[1] > 1])
Expand All @@ -217,13 +214,13 @@ def roslaunch_uris_check(ctx):
# uris only contains the parent launches
for uri in ctx.roslaunch_uris:
try:
r = ServerProxy(uri)
r = rosgraph.xmlrpc.ServerProxy(uri)
code, msg, val = r.list_children()
# check the children launches
if code == 1:
for child_uri in val:
try:
r = ServerProxy(uri)
r = rosgraph.xmlrpc.ServerProxy(uri)
code, msg, val = r.get_pid()
except:
bad.append(child_uri)
Expand All @@ -235,7 +232,7 @@ def roslaunch_dead_check(ctx):
dead = []
for uri in ctx.roslaunch_uris:
try:
r = ServerProxy(uri)
r = rosgraph.xmlrpc.ServerProxy(uri)
code, msg, val = r.list_processes()
_, dead_list = val
dead.extend([d[0] for d in dead_list])
Expand Down

0 comments on commit 82bb411

Please sign in to comment.