You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When using any of the namecheap execution modules, I receive the following error:
Passed invalid arguments to namecheap_<module>.<function>: must be str, not NoneType
Example with namecheap_users.check_balances:
INFO ] User root Executing command namecheap_users.check_balances with jid 20211110005553905719
[DEBUG ] Command details {'fun': 'namecheap_users.check_balances', 'arg': [], 'tgt': 'salt01', 'jid': '20211110005553905719', 'ret': '', 'tgt_type': 'glob', 'user': 'root'}
[DEBUG ] Subprocess ProcessPayload-Job-20211110005553905719 added
[DEBUG ] Using importlib_metadata to load entry points
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[INFO ] Starting a new job 20211110005553905719 with PID 832773
[DEBUG ] Could not LazyLoad direct_call.allow_missing_func: 'direct_call.allow_missing_func' is not available.
[DEBUG ] LazyLoaded namecheap_users.check_balances
[WARNING ] Passed invalid arguments to namecheap_users.check_balances: 'NoneType' object is not subscriptable
Checks if the provided minimum value is present in the user's account.
Returns a boolean. Returns ``False`` if the user's account balance is less
than the provided minimum or ``True`` if greater than the minimum.
minimum : 100
The value to check
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_users.check_balances
salt 'my-minion' namecheap_users.check_balances minimum=150
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1912, in _thread_return
function_name, function_args, executors, opts, data
File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1868, in _execute_job_function
return_data = self.executors[fname](opts, data, func, args, kwargs)
File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 1201, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/contextvars/__init__.py", line 38, in run
return callable(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 1216, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 10, in execute
return func(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 149, in __call__
return self.loader.run(run_func, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 1201, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/contextvars/__init__.py", line 38, in run
return callable(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/loader/lazy.py", line 1216, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/salt/modules/namecheap_users.py", line 94, in check_balances
result = get_balances()
File "/usr/lib/python3.6/site-packages/salt/modules/namecheap_users.py", line 64, in get_balances
opts = salt.utils.namecheap.get_opts("namecheap.users.getBalances")
File "/usr/lib/python3.6/site-packages/salt/utils/namecheap.py", line 156, in get_opts
opts["ApiUser"] = __salt__["config.option"]("namecheap.name")
TypeError: 'NoneType' object is not subscriptable
[DEBUG ] Minion return retry timer set to 5 seconds (randomized)
[INFO ] Returning information for job: 20211110005553905719
[DEBUG ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'salt01', 'tcp://127.0.0.1:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
[DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
[DEBUG ] Closing AsyncZeroMQReqChannel instance
[DEBUG ] minion return: {'success': False, 'return': "Passed invalid arguments to namecheap_users.check_balances: 'NoneType' object is not subscriptable\n\n Checks
if the provided minimum value is present in the user's account.\n\n Returns a boolean. Returns ``False`` if the user's account balance is less\n than the provided
minimum or ``True`` if greater than the minimum.\n\n minimum : 100\n The value to check\n\n CLI Example:\n\n .. code-block:: bash\n\n salt 'my-minion' namecheap_users.check_balances\n salt 'my-minion' namecheap_users.check_balances minimum=150\n\n ", 'out': 'nested', 'retcode': 1, 'jid': '20211110005553905719', 'fun': 'namecheap_users.check_balances', 'fun_args': []}
It looks like the __salt__ dunder is set to None in utils/namecheap.py (and not subsequently set), and as such it can't read the config.
Description
When using any of the namecheap execution modules, I receive the following error:
Passed invalid arguments to namecheap_<module>.<function>: must be str, not NoneType
Example with
namecheap_users.check_balances
:It looks like the
__salt__
dunder is set to None in utils/namecheap.py (and not subsequently set), and as such it can't read the config.Setup
/etc/salt/minion.d/namecheap.conf:
Please be as specific as possible and give set-up details.
AlmaLinux 8 VM on VMware vSphere 7.0. Minion is running on same host as master.
Steps to Reproduce the behavior
$ salt minion namecheap_users.check_balances
Expected behavior
Return whether the account balance exceeds $100
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)The text was updated successfully, but these errors were encountered: