Skip to content

Commit

Permalink
Merge pull request #164 from mossmann/setup
Browse files Browse the repository at this point in the history
cli: Don't require device to create udev rule
  • Loading branch information
antoinevg authored Aug 6, 2024
2 parents 3015aab + 3e11c94 commit 96271e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cynthion/python/src/commands/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def main():
force_offline = args.force_offline if "force_offline" in args else True

# Execute the relevant command.
if args.func is cynthion_info:
if args.func in (cynthion_info, cynthion_setup):
args.func(args)
else:
device = ApolloDebugger(force_offline=force_offline)
Expand Down
14 changes: 7 additions & 7 deletions cynthion/python/src/commands/cynthion_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
UDEV_CYNTHION = "54-cynthion.rules"


def cynthion_setup(device, args):
def cynthion_setup(args):
if args.check:
_check_udev(device, args)
_check_udev(args)
elif args.uninstall:
_uninstall_udev(device, args)
_uninstall_udev(args)
else:
_install_udev(device, args)
_install_udev(args)


def _check_udev(device, args):
def _check_udev(args):
logging.info("Checking: Linux udev rules")

sys_path = os.path.join(UDEV_PATH, UDEV_CYNTHION)
Expand All @@ -48,7 +48,7 @@ def _check_udev(device, args):
logging.info("\nAll checks completed successfully.")


def _install_udev(device, args):
def _install_udev(args):
logging.info("Installing: Linux udev rules")

src = find_cynthion_asset(UDEV_CYNTHION)
Expand All @@ -66,7 +66,7 @@ def _install_udev(device, args):
logging.info("\nInstallation completed successfully.")


def _uninstall_udev(device, args):
def _uninstall_udev(args):
logging.info("Uninstalling: Linux udev rules")

rules = os.path.join(UDEV_PATH, UDEV_CYNTHION)
Expand Down

0 comments on commit 96271e0

Please sign in to comment.