Skip to content

[BUG] Traceback when cassandra python libraries are unavailable #62886

Closed
@garethgreenaway

Description

Description
when the cassandra python library is unavailable the following traceback is shown when running some Salt commands.

[ERROR   ] Failed to import module cassandra_cql, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/home/gareth/code/salt/salt/loader/lazy.py", line 768, in _load_module
    mod = self.run(spec.loader.load_module)
  File "/home/gareth/code/salt/salt/loader/lazy.py", line 1228, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/home/gareth/code/salt/salt/loader/lazy.py", line 1243, in _run_as
    return _func_or_method(*args, **kwargs)
  File "<frozen importlib._bootstrap_external>", line 407, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 907, in load_module
  File "<frozen importlib._bootstrap_external>", line 732, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/gareth/code/salt/salt/modules/cassandra_cql.py", line 144, in <module>
    "HostDistance": HostDistance,
NameError: name 'HostDistance' is not defined

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3005.1+683.g1404abe773
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.4
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.15.0
        pygit2: Not Installed
        Python: 3.7.7 (default, Sep  4 2020, 16:48:08)
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 20.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.3
 
System Versions:
          dist: manjaro 22.0.0 Sikaris
        locale: UTF-8
       machine: x86_64
       release: 5.17.15-1-MANJARO
        system: Linux
       version: Manjaro Linux 22.0.0 Sikaris

Additional context
Add any other context about the problem here.

Metadata

Labels

Bugbroken, incorrect, or confusing behavior

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions