diff --git a/salt/config/__init__.py b/salt/config/__init__.py index 43182f3f92..d8258a4dbc 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -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 @@ -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: