Skip to content

Commit

Permalink
Dereference symlinks to set proper __cli
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhestkov authored and meaksh committed Oct 31, 2023
1 parent b2baafc commit 9b0f9c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions salt/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3747,7 +3747,9 @@ def apply_minion_config(
)
opts["fileserver_backend"][idx] = new_val

opts["__cli"] = salt.utils.stringutils.to_unicode(os.path.basename(sys.argv[0]))
opts["__cli"] = salt.utils.stringutils.to_unicode(
os.path.basename(salt.utils.path.expand(sys.argv[0]))
)

# No ID provided. Will getfqdn save us?
using_ip_for_id = False
Expand Down Expand Up @@ -3949,7 +3951,9 @@ def apply_master_config(overrides=None, defaults=None):
)
opts["keep_acl_in_token"] = True

opts["__cli"] = salt.utils.stringutils.to_unicode(os.path.basename(sys.argv[0]))
opts["__cli"] = salt.utils.stringutils.to_unicode(
os.path.basename(salt.utils.path.expand(sys.argv[0]))
)

if "environment" in opts:
if opts["saltenv"] is not None:
Expand Down

0 comments on commit 9b0f9c4

Please sign in to comment.