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

Proper null checking for variables #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tasks/Darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} +
['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']"
when:
- az_devops_deployment_group_tags is defined
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None

- name: Set proxy
set_fact:
agent_cmd_args: "{{ agent_cmd_args }} + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'',
'--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\'']"
when:
- az_devops_proxy_url is defined
- az_devops_proxy_url is defined and az_devops_proxy_url != None

- name: Uninstall agent service
command: ./svc.sh uninstall
Expand Down
4 changes: 2 additions & 2 deletions tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} +
['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']"
when:
- az_devops_deployment_group_tags is defined
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None

- name: Set proxy
set_fact:
agent_cmd_args: "{{ agent_cmd_args }} + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'', '--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\'']"
when:
- az_devops_proxy_url is defined
- az_devops_proxy_url is defined and az_devops_proxy_url != None

- name: Download and unarchive
unarchive:
Expand Down
8 changes: 4 additions & 4 deletions tasks/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@
set_fact:
deployment_install_options: "{{ deployment_install_options }} + ['/DeploymentGroupTags:{{ az_devops_deployment_group_tags }}']"
when:
- az_devops_deployment_group_tags is defined
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None

- name: Add az_devops_proxy_url
set_fact:
common_install_options: "{{ common_install_options }} + ['/ProxyUrl:{{ az_devops_proxy_url }}']"
when:
- az_devops_proxy_url is defined and az_devops_proxy_url
- az_devops_proxy_url is defined and az_devops_proxy_url != None

- name: Add az_devops_proxy_username
set_fact:
common_install_options: "{{ common_install_options }} + ['/ProxyUserName:{{ az_devops_proxy_username }}']"
when:
- az_devops_proxy_username is defined and az_devops_proxy_username
- az_devops_proxy_username is defined and az_devops_proxy_username != None

- name: Add az_devops_proxy_password
set_fact:
common_install_options: "{{ common_install_options }} + ['/ProxyPassword:{{ az_devops_proxy_password }}']"
when:
- az_devops_proxy_password is defined and az_devops_proxy_password
- az_devops_proxy_password is defined and az_devops_proxy_password != None

- name: Configure agent as a build server
set_fact:
Expand Down