Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks with ansible devel/ansible 2.8+ #28

Closed
kdelee opened this issue Feb 7, 2019 · 4 comments
Closed

Breaks with ansible devel/ansible 2.8+ #28

kdelee opened this issue Feb 7, 2019 · 4 comments

Comments

@kdelee
Copy link
Member

kdelee commented Feb 7, 2019

I get this traceback:

Traceback (most recent call last):                                                                                                                                                                                
  File "/home/elijah/sfw/ansible/py3-tower-qa/tests/api/inventories/test_group.py", line 85, in root_variation     
    content="""# --inventory-id %s %s""" % (inventory.id, request.param['inventory'])                                                                                                                             
  File "/home/elijah/envs/py36towerqa/lib64/python3.6/site-packages/pytest_ansible/module_dispatcher/v24.py", line 81, in _run
    parser = CLI.base_parser(                                                                                                
AttributeError: type object 'CLI' has no attribute 'base_parser'   

I'm guessing ansible/ansible@7e92ff8
impacted this?

@abadger if you have any input on what proper use should be in these two places, or how to be compatible with older versions as well as the new way, it would be appreciated!

parser = CLI.base_parser(

Maybe we need a module_dispatcher/v28.py

@kdelee
Copy link
Member Author

kdelee commented Feb 7, 2019

abadger1999 [9:59 AM]
@elijahd I don't know what pytest-ansible does other than the bug report you CC'd me on but the README makes it sound like it could be replaced with /usr/bin/ansible with the json callback or similar?

abadger1999 [10:00 AM]
I mention that because porting pytest-ansible this time won't protest you against the next time a change occurs in the internal functionality.

🤔 something to consider

@jlaska
Copy link
Contributor

jlaska commented Feb 8, 2019

Considered. This describes the problem since the dawn of time (or at least ansible time). pytest-ansible relies on potentially unstable APIs (there are no stable ones). There are ways we can improve the situation, and Runner may be an area to explore as it didn't exist until recently.

Let's leave this issue open until pytest-ansible can adapt to the changes.

@kdelee
Copy link
Member Author

kdelee commented Feb 14, 2019

Fixed by #30

@06shalini
Copy link

Earlier i was seeing this issue and then I updated my pytest-ansible and ansible ,
But Now I am facing below issue.
my pytest execution hangs for really long time and fails saying host unreachable.
My host is reachable without any password/ key. { ssh root@IP }

Command:
py.test --ansible-inventory hosts --user root --ansible-host-pattern master pytest/sanity/test_role_users_kra.py -q -s --junitxml role_user_creation_junit.xml -qsvv --debug

.

.
.
plugins: metadata-1.10.0, logger-0.3.0, html-1.22.1, autochecklog-0.2.0, ansible-2.2.2, ansible-playbook-0.3.0
collected 2 items
pytest/sanity/test_role_users_kra.py INFO - ------------------------------------------------------
INFO:Test:------------------------------------------------------
INFO - Func test_setup_kra_role_users in file: /root/pki-pytest-ansible/pytest/sanity/test_role_users_kra.py
INFO:Test:Func test_setup_kra_role_users in file: /root/pki-pytest-ansible/pytest/sanity/test_role_users_kra.py
Loading callback plugin unnamed of type old, v1.0 from /usr/lib/python2.7/site-packages/pytest_ansible/module_dispatcher/v28.py
META: ran handlers
<10.0.151.209> ESTABLISH SSH CONNECTION FOR USER: root
<10.0.151.209> SSH: ansible.cfg set ssh_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<10.0.151.209> SSH: ansible_password/ansible_ssh_password not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<10.0.151.209> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User="root")
.
.
.
.
.
.

<10.0.151.209> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/af01c08f47 10.0.151.209 '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1596797381.57-70538618513074/ /root/.ansible/tmp/ansible-tmp-1596797381.57-70538618513074/AnsiballZ_command.py && sleep 0'"'"''
<10.0.151.209> (0, '', 'OpenSSH_7.7p1, OpenSSL 1.1.0h-fips 27 Mar 2018\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: /root/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf\r\ndebug3: /etc/ssh/ssh_config.d/05-redhat.conf line 2: Including file /etc/crypto-policies/back-ends/openssh.config depth 1\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-]\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1]\r\ndebug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 10.0.151.209 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 620\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<10.0.151.209> ESTABLISH SSH CONNECTION FOR USER: root
<10.0.151.209> SSH: ansible.cfg set ssh_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<10.0.151.209> SSH: ansible_password/ansible_ssh_password not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<10.0.151.209> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User="root")
<10.0.151.209> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<10.0.151.209> SSH: PlayContext set ssh_common_args: ()
<10.0.151.209> SSH: PlayContext set ssh_extra_args: ()
<10.0.151.209> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/af01c08f47)
<10.0.151.209> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/af01c08f47 -tt 10.0.151.209 '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1596797381.57-70538618513074/AnsiballZ_command.py && sleep 0'"'"''

Versions used:
ansible==2.8.0
pytest==3.6.3
pytest-ansible==2.2.2
pytest-ansible-playbook==0.3.0
pytest-autochecklog==0.2.0
pytest-html==1.22.1
pytest-logger==0.3.0
pytest-metadata==1.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants