fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
84 stars 48 forks source link

SyntaxError: invalid syntax #177

Closed hswong3i closed 2 years ago

hswong3i commented 2 years ago

When packing Ansible 5.7.0 as .deb/.rpm (see https://github.com/alvistack/ansible-community-ansible-build-data/commit/f3cb88964b44be336e8d543309c80b4d7d442d50), apt generate following error message when install the result package:

Setting up ansible (100:5.7.0-1) ...
  File "/usr/lib/python3/dist-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_wirel
ess_controller_hotspot20_h2qp_advice_of_charge.py", line 281
    filtered_data =
                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3/dist-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_wirel
ess_controller_hotspot20_h2qp_osu_provider_nai.py", line 238
    filtered_data =
                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3/dist-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_wirel
ess_controller_hotspot20_h2qp_terms_and_conditions.py", line 236
    filtered_data =
                  ^
SyntaxError: invalid syntax

dpkg: error processing package ansible (--configure):
 installed ansible package post-installation script subprocess returned error exit status 1

Fixes https://github.com/ansible-community/ansible-build-data/issues/114

felixfontein commented 2 years ago

Code: https://github.com/fortinet-ansible-dev/ansible-galaxy-fortios-collection/blob/fos_v6.0.0/galaxy_2.1.5/plugins/modules/fortios_wireless_controller_hotspot20_h2qp_advice_of_charge.py#L281

This should have never passed the sanity tests. Are these actually running? If not, this is a violation of the Ansible community package requirements.

gundalow commented 2 years ago

@hswong3i Thanks for the fix.

Maintainers: This would spotted earlier if you have CI running, I've created https://github.com/fortinet-ansible-dev/ansible-galaxy-fortios-collection/pull/178 to add the standard Sanity Tests.

hswong3i commented 2 years ago

Before this get fixed, my temporary solution for Ansible 5.7.0 packaging with on-the-fly patching (https://github.com/alvistack/ansible-community-ansible-build-data/commit/f014f4413c7f57c21891e9a3de4ab34d89194fd1):

    git clean -xdf
    pip download -d /tmp --no-deps --no-binary=:all: ansible==5.7.0
    tar zxvf /tmp/ansible-5.7.0.tar.gz --strip-components=1 --exclude=debian --exclude=ansible.egg-info
    pushd ansible_collections/fortinet/fortios; curl -skL https://patch-diff.githubusercontent.com/raw/fortinet-ansible-dev/ansible-galaxy-fortios-collection/pull/177.patch | patch -p1; popd
    tar zcvf ../python-ansible_5.7.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-ansible.spec ../python-ansible_5.7.0-1.spec
    mv ../python*-ansible*5.7.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-ansible-build-data-5.7.0/
    rm -rf ../python*-ansible*5.7.0*.* ../ansible*5.7.0*.*
gundalow commented 2 years ago

@JieX19 Could we get a new release of the collection with this fix in.

mtovmassian commented 2 years ago

Made my upgrade to Ansible 5.7.0 crash. What is the estimate to have this fix in the package?

peter279k commented 2 years ago

Made my upgrade to Ansible 5.7.0 crash. What is the estimate to have this fix in the package?

Same as here. It's failed when installing the Ansible 5.7 version.

jesusplanas commented 2 years ago

same issue here, any ETA to solve it?

dmsimard commented 2 years ago

There hasn't been a new release of this collection with the fix included yet so we will do a release of ansible 5.7.1 with the version of fortinet.fortios rolled back to 2.1.4 (down from 2.1.5).

JieX19 commented 2 years ago

There hasn't been a new release of this collection with the fix included yet so we will do a release of ansible 5.7.1 with the version of fortinet.fortios rolled back to 2.1.4 (down from 2.1.5).

I will release it by this Friday. I saw you've downgrade FOS collection to 2.1.4