Skip to content

Commit

Permalink
Add debug argument to spawn_daemon
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
  • Loading branch information
ivanpauno committed Oct 16, 2019
1 parent e16888f commit e339123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ros2cli/ros2cli/node/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def is_daemon_running(args):
return False


def spawn_daemon(args, wait_until_spawned=None):
def spawn_daemon(args, wait_until_spawned=None, debug=False):
ros_domain_id = int(os.environ.get('ROS_DOMAIN_ID', 0))
kwargs = {}
if platform.system() != 'Windows':
Expand Down Expand Up @@ -76,7 +76,7 @@ def spawn_daemon(args, wait_until_spawned=None):
# the arguments are only passed for visibility in e.g. the process list
'--rmw-implementation', rmw_implementation_identifier,
'--ros-domain-id', str(ros_domain_id)])
if not hasattr(args, 'debug') or not args.debug:
if not debug:
kwargs['stdout'] = subprocess.DEVNULL
kwargs['stderr'] = subprocess.DEVNULL
subprocess.Popen(cmd, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion ros2cli/ros2cli/verb/daemon/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def main(self, *, args):
print('The daemon is already running')
return

spawned = spawn_daemon(args, wait_until_spawned=10.0)
spawned = spawn_daemon(args, wait_until_spawned=10.0, debug=args.debug)
if spawned:
print('The daemon has been started')
else:
Expand Down

0 comments on commit e339123

Please sign in to comment.