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

Fix failed_when in template_root check with wp-cli 1.5.0 #948

Merged
merged 1 commit into from
Feb 9, 2018

Conversation

fullyint
Copy link
Contributor

@fullyint fullyint commented Feb 9, 2018

Previous wp-cli versions returned rc=1 and stderr='' for wp option get template_root when the option didn't exist. Version 1.5.0 (#944) uses a new stderr message.

This PR changes to only failing if stderr is not empty and does not match this new and expected message.

Alternatively, it would probably be fine to simply use failed_when: false

This PR prevents errors like the following:

TASK [deploy : Get WP theme template and stylesheet roots] *****************************************
System info:
  Ansible 2.4.3.0; Darwin
  Trellis at "Bump Ansible `version_tested_max` to 2.4.3.0"
---------------------------------------------------
non-zero return code
Error: Could not get 'template_root' option. Does it exist?
failed: [138.68.203.29] (item=template_root) => {"changed": false, "cmd": " wp option get 
template_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.343446", "end": "2018-02-08 
23:36:30.191017", "failed_when_result": true, "item": "template_root", "rc": 1, "start": "2018-02-08 
23:36:29.847571", "stderr_lines": ["Error: Could not get 'template_root' option. Does it exist?"], 
"stdout": "", "stdout_lines": []}
---------------------------------------------------
non-zero return code
Error: Could not get 'stylesheet_root' option. Does it exist?
failed: [138.68.203.29] (item=stylesheet_root) => {"changed": false, "cmd": " wp option get 
stylesheet_root --skip-plugins --skip-themes\n ", "delta": "0:00:00.372746", "end": "2018-02-08 
23:36:30.911272", "failed_when_result": true, "item": "stylesheet_root", "rc": 1, "start": "2018-02-08 
23:36:30.538526", "stderr_lines": ["Error: Could not get 'stylesheet_root' option. Does it exist?"], 
"stdout": "", "stdout_lines": []}

Previous wp-cli versions returned rc=1 and stderr='' for
`wp option get template_root` when the option didn't exist.
Version 1.5.0 uses a new stderr message.
@fullyint fullyint merged commit 658c9ee into master Feb 9, 2018
@fullyint fullyint deleted the wp-template-root branch February 9, 2018 02:52
primozcigler added a commit to proteusthemes/pt-ops that referenced this pull request Mar 13, 2018
* trellis/master:
  Ensure Diffie-Hellman group is generated for Let's Encrypt (roots#964)
  Fix raw_vars feature to properly handle int values (roots#959)
  Update Ansible default plugin paths in config files (roots#958)
  Add Nginx ssl.no-default.conf to drop requests for unknown hosts (roots#888)
  Disable memcached UDP support by default
  Git: Ignore `vagrant.local.yml`
  Add sponsors [ci skip]
  Set Vagrant's ansible compatibility_mode
  Check and stop php7.1-fpm service
  Update to PHP 7.2
  Fix failed_when in template_root check with wp-cli 1.5.0 (roots#948)
  Bump Ansible version_tested_max to 2.4.3.0 (roots#945)
  Update wp-cli to 1.5.0 (roots#944)
  Update `vagrant_box_version` to `>= 201801.02.0`
  Update `vagrant_box_version` to `<= 201801.02.0`
  Update Vagrant requirement to v2.0.1.
  Support for IPv6 in Letsencrypt challenges
  Allow Trellis VMs to be created/provisioned in Windows Subsystem for Linux.
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

Successfully merging this pull request may close these issues.

2 participants