Package: crmsh
Version: 5.0.0-3
Severity: serious

=================================== FAILURES
===================================
_____________________________ test_when_expression
_____________________________

    def test_when_expression():
        """
        Test when expressions
        """
        def runtest(when, val):
            the_script = '''version: 2.2
    shortdesc: Test when expressions
    longdesc: See if more complicated expressions work
    parameters:
      - name: stringtest
        type: string
        shortdesc: A test string
    actions:
      - call: "echo '{{stringtest}}'"
        when: %s
    '''
            scrpt = scripts.load_script_string('{}_{}'.format(when, val),
the_script % when)
            assert scrpt is not None

            a1 = scripts.verify(scrpt,
                                {"stringtest": val},
                                external_check=False)
            pprint(a1)
            return a1

>       a1 = runtest('stringtest == "balloon"', "balloon")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/usr/share/crmsh/tests/unittests/test_scripts.py:896:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/share/crmsh/tests/unittests/test_scripts.py:890: in runtest
    a1 = scripts.verify(scrpt,
/usr/lib/python3/dist-packages/crmsh/scripts.py:2198: in verify
    actions = _process_actions(script, params)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/crmsh/scripts.py:2173: in _process_actions
    when = str(action['when']).strip()
           ^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/crmsh/scripts.py:134: in __str__
    return str(minieval(inp, lenv)).lower()
               ^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/crmsh/minieval.py:370: in minieval
    return SimpleEval(env).evaluate(expr)
           ^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <crmsh.minieval.SimpleEval object at 0x7f5601729010>
names = {'stringtest': 'balloon', 'nodes': None, 'dry_run': 'no', 'action':
None, ...}

    def __init__(self, names):
        """
            Create the evaluator instance.  Set up valid operators (+,-, etc)
            functions (add, random, get_val, whatever) and names. """

        operators = DEFAULT_OPERATORS
        names = names.copy()
        names.update(DEFAULT_NAMES)

        self.operators = operators
        self.names = names

        self.nodes = {
>           ast.Num: self._eval_num,
            ^^^^^^^
            ast.Str: self._eval_str,
            ast.Name: self._eval_name,
            ast.UnaryOp: self._eval_unaryop,
            ast.BinOp: self._eval_binop,
            ast.BoolOp: self._eval_boolop,
            ast.Compare: self._eval_compare,
            ast.IfExp: self._eval_ifexp,
            ast.keyword: self._eval_keyword,
            ast.Subscript: self._eval_subscript,
            ast.Attribute: self._eval_attribute,
            ast.Index: self._eval_index,
            ast.Slice: self._eval_slice,
        }
E       AttributeError: module 'ast' has no attribute 'Num'

/usr/lib/python3/dist-packages/crmsh/minieval.py:186: AttributeError
____________________________ TestSBD.test_do_purge
_____________________________

self = <unittests.test_ui_sbd.TestSBD testMethod=test_do_purge>
mock_purge_sbd_from_cluster = <MagicMock name='purge_sbd_from_cluster'
id='140007337183616'>
mock_check_all_nodes_reachable = <MagicMock name='check_all_nodes_reachable'
id='140007337193360'>

    @mock.patch('crmsh.utils.check_all_nodes_reachable')
    @mock.patch('crmsh.sbd.purge_sbd_from_cluster')
    def test_do_purge(self, mock_purge_sbd_from_cluster,
mock_check_all_nodes_reachable):
        self.sbd_instance_diskbased._load_attributes = mock.Mock()
        self.sbd_instance_diskbased._service_is_active =
mock.Mock(return_value=True)
>       res = self.sbd_instance_diskbased.do_purge(mock.Mock())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/usr/share/crmsh/tests/unittests/test_ui_sbd.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/crmsh/ui_sbd.py:590: in do_purge
    sbd.SBDManager.restart_cluster_if_possible()
/usr/lib/python3/dist-packages/crmsh/sbd.py:565: in restart_cluster_if_possible
    bootstrap.restart_cluster()
/usr/lib/python3/dist-packages/crmsh/bootstrap.py:2911: in restart_cluster
    utils.cluster_run_cmd("crm cluster restart")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = 'crm cluster restart', node_list = []

    def cluster_run_cmd(cmd, node_list=[]):
        """
        Run cmd in cluster nodes
        """
        nodelist = node_list or list_cluster_nodes()
        if not nodelist:
>           raise ValueError("Failed to get node list from cluster")
E           ValueError: Failed to get node list from cluster

/usr/lib/python3/dist-packages/crmsh/utils.py:1743: ValueError
----------------------------- Captured stdout call
-----------------------------
.EXT cibadmin -Q
=========================== short test summary info
============================
FAILED test_scripts.py::test_when_expression - AttributeError: module 'ast' has
no attribute 'Num'
FAILED test_ui_sbd.py::TestSBD::test_do_purge - ValueError: Failed to get node
list from cluster


-- System Information:
Debian Release: forky/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), 
(101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 7.0.12+deb14.1-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages crmsh depends on:
ii  gawk                 1:5.3.2-1
ii  iputils-ping         3:20250605-1
pn  pacemaker-cli-utils  <none>
ii  python3              3.13.9-3+b1
ii  python3-dateutil     2.9.0-4
ii  python3-lxml         6.1.0-1
ii  python3-packaging    26.2-2
ii  python3-yaml         6.0.3-1

Versions of packages crmsh recommends:
pn  pacemaker  <none>

Versions of packages crmsh suggests:
ii  bash-completion    1:2.16.0-8
pn  cluster-glue       <none>
pn  csync2             <none>
ii  dmidecode          3.7-1
ii  fdisk              2.42.2-1
pn  ocfs2-tools        <none>
ii  openssh-server     1:10.3p1-5
ii  parted             3.7-1
pn  sbd                <none>
pn  ufw                <none>
ii  util-linux         2.42.2-1
ii  util-linux-extra   2.42.2-1
ii  vim-addon-manager  0.5.11

Reply via email to