Skip to content

Commit

Permalink
Fix pre-commit warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bijoua29 committed Mar 20, 2023
1 parent b575349 commit 3f6d413
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions controller_manager/controller_manager/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,17 @@ def main(args=None):
if not wait_for_controller_manager(
node, controller_manager_name, controller_manager_timeout
):
node.get_logger().error(bcolors.FAIL + "Controller manager not available" + bcolors.ENDC)
node.get_logger().error(
bcolors.FAIL + "Controller manager not available" + bcolors.ENDC
)
return 1

if is_controller_loaded(node, controller_manager_name, prefixed_controller_name):
node.get_logger().warn(bcolors.WARNING + "Controller already loaded, skipping load_controller" + bcolors.ENDC)
node.get_logger().warn(
bcolors.WARNING
+ "Controller already loaded, skipping load_controller"
+ bcolors.ENDC
)
else:
if controller_type:
parameter = Parameter()
Expand Down Expand Up @@ -317,15 +323,19 @@ def main(args=None):
if not args.load_only:
ret = configure_controller(node, controller_manager_name, controller_name)
if not ret.ok:
node.get_logger().error(bcolors.FAIL + "Failed to configure controller" + bcolors.ENDC)
node.get_logger().error(
bcolors.FAIL + "Failed to configure controller" + bcolors.ENDC
)
return 1

if not args.inactive:
ret = switch_controllers(
node, controller_manager_name, [], [controller_name], True, True, 5.0
)
if not ret.ok:
node.get_logger().error(bcolors.FAIL + "Failed to activate controller" + bcolors.ENDC)
node.get_logger().error(
bcolors.FAIL + "Failed to activate controller" + bcolors.ENDC
)
return 1

node.get_logger().info(
Expand All @@ -350,14 +360,18 @@ def main(args=None):
node, controller_manager_name, [controller_name], [], True, True, 5.0
)
if not ret.ok:
node.get_logger().error(bcolors.FAIL + "Failed to deactivate controller" + bcolors.ENDC)
node.get_logger().error(
bcolors.FAIL + "Failed to deactivate controller" + bcolors.ENDC
)
return 1

node.get_logger().info("Deactivated controller")

ret = unload_controller(node, controller_manager_name, controller_name)
if not ret.ok:
node.get_logger().error(bcolors.FAIL + "Failed to unload controller" + bcolors.ENDC)
node.get_logger().error(
bcolors.FAIL + "Failed to unload controller" + bcolors.ENDC
)
return 1

node.get_logger().info("Unloaded controller")
Expand Down

0 comments on commit 3f6d413

Please sign in to comment.