Skip to content

[Bug]: hermes uninstall script error NameError: name 'os' is not defined #6983

@zetao57

Description

@zetao57

Bug Description

hermes uninstall command will output error:
File "/home/admin/.hermes/hermes-agent/hermes_cli/uninstall.py", line 126, in uninstall_gateway_service prefix = os.getenv("PREFIX", "") ^^ NameError: name 'os' is not defined

Steps to Reproduce

1.Run "hermes uninstall"

Expected Behavior

Uninstall complete

Actual Behavior

Output NameError: name 'os' is not defined

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Operating System

Debian 12

Python Version

3.11.2

Hermes Version

0.8.0

Relevant Logs / Traceback

Uninstalling...

→ Checking for gateway service...
Traceback (most recent call last):
  File "/home/admin/.local/bin/hermes", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/admin/.hermes/hermes-agent/hermes_cli/main.py", line 5662, in main
    args.func(args)
  File "/home/admin/.hermes/hermes-agent/hermes_cli/main.py", line 2698, in cmd_uninstall
    run_uninstall(args)
  File "/home/admin/.hermes/hermes-agent/hermes_cli/uninstall.py", line 251, in run_uninstall
    if uninstall_gateway_service():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/.hermes/hermes-agent/hermes_cli/uninstall.py", line 126, in uninstall_gateway_service
    prefix = os.getenv("PREFIX", "")
             ^^
NameError: name 'os' is not defined

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

Add line 'import os;' in file /home/admin/.hermes/hermes-agent/hermes_cli/uninstall.py

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions