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

[BUG]Can create folder in upper case but cannot access the folder #662

Open
mike1098 opened this issue Sep 26, 2024 · 10 comments
Open

[BUG]Can create folder in upper case but cannot access the folder #662

mike1098 opened this issue Sep 26, 2024 · 10 comments
Assignees
Labels
bug Something isn't working module:folder This affects the folder module release:5.3.0 Affects the mentioned release.

Comments

@mike1098
Copy link

Describe the bug

I can create a folder in upper case:

 - name: "Create a country folder."
    checkmk.general.folder:
      server_url: "http://myserver/"
      site: "rest"
      automation_user: "automation"
      automation_secret: "xyz"
      path: "/local_monitoring/DE
      name: "DE"
      attributes:
        site: "rest"
        contactgroups:
          groups:
            - "DE-BackOffice"
          use: true
          use_for_services: true
          recurse_use: true
          recurse_perms: true
      state: "present"

But if I then try to cerate a subfolder it fails because path is forced to be in lower case.

- name: "Create a site folder."
   checkmk.general.folder:
     extended_functionality: false
     server_url: "http://myserver/"
     site: "rest"
     automation_user: "automation"
     automation_secret: "xyz"
     path: "/local_monitoring/DE/AUG"
     name: "AUG"
     attributes:
       site: "rest"
       contactgroups:
         groups:
           - "DE-AUG-BackOffice"
         use: true
         use_for_services: true
         recurse_use: true
         recurse_perms: true
     state: "present"

### Error message:
"These fields have problems: parent", "fields": {"parent": ["The folder \‘/local_monitoring/de\’ could not be found."]}}'"}

Component Name

Component Name: folder

Ansible Version

$ ansible --version
ansible [core 2.16.3]

Checkmk Version and Edition

2.2.0p33.cee

Collection Version

[root@xxx~]# ansible-galaxy -vvv collection list

# /usr/lib/python3.12/site-packages/ansible_collections
Collection                               Version
---------------------------------------- -------
amazon.aws                               7.2.0
ansible.netcommon                        5.3.0
ansible.posix                            1.5.4
ansible.utils                            2.12.0
ansible.windows                          2.2.0
arista.eos                               6.2.2
awx.awx                                  23.6.0
azure.azcollection                       1.19.0
check_point.mgmt                         5.2.2
chocolatey.chocolatey                    1.5.1
cisco.aci                                2.8.0
cisco.asa                                4.0.3
cisco.dnac                               6.10.2
cisco.intersight                         2.0.7
cisco.ios                                5.3.0
cisco.iosxr                              6.1.1
cisco.ise                                2.7.0
cisco.meraki                             2.17.2
cisco.mso                                2.5.0
cisco.nxos                               5.3.0
cisco.ucs                                1.10.0
cloud.common                             2.1.4
cloudscale_ch.cloud                      2.3.1
community.aws                            7.1.0
community.azure                          2.0.0
community.ciscosmb                       1.0.7
community.crypto                         2.17.1
community.digitalocean                   1.26.0
community.dns                            2.8.0
community.docker                         3.7.0
community.general                        8.3.0
community.grafana                        1.7.0
community.hashi_vault                    6.1.0
community.hrobot                         1.9.0
community.library_inventory_filtering_v1 1.0.0
community.libvirt                        1.3.0
community.mongodb                        1.6.3
community.mysql                          3.8.0
community.network                        5.0.2
community.okd                            2.3.0
community.postgresql                     3.3.0
community.proxysql                       1.5.1
community.rabbitmq                       1.2.3
community.routeros                       2.12.0
community.sap                            2.0.0
community.sap_libs                       1.4.2
community.sops                           1.6.7
community.vmware                         4.1.0
community.windows                        2.1.0
community.zabbix                         2.3.1
containers.podman                        1.11.0
cyberark.conjur                          1.2.2
cyberark.pas                             1.0.25
dellemc.enterprise_sonic                 2.4.0
dellemc.openmanage                       8.7.0
dellemc.powerflex                        2.1.0
dellemc.unity                            1.7.1
f5networks.f5_modules                    1.27.1
fortinet.fortimanager                    2.3.1
fortinet.fortios                         2.3.4
frr.frr                                  2.0.2
gluster.gluster                          1.0.2
google.cloud                             1.3.0
grafana.grafana                          2.2.4
hetzner.hcloud                           2.4.1
hpe.nimble                               1.1.4
ibm.qradar                               2.1.0
ibm.spectrum_virtualize                  2.0.0
ibm.storage_virtualize                   2.2.0
infinidat.infinibox                      1.3.12
infoblox.nios_modules                    1.6.1
inspur.ispim                             2.2.0
inspur.sm                                2.3.0
junipernetworks.junos                    5.3.1
kubernetes.core                          2.4.0
lowlydba.sqlserver                       2.2.2
microsoft.ad                             1.4.1
netapp.aws                               21.7.1
netapp.azure                             21.10.1
netapp.cloudmanager                      21.22.1
netapp.elementsw                         21.7.0
netapp.ontap                             22.9.0
netapp.storagegrid                       21.11.1
netapp.um_info                           21.8.1
netapp_eseries.santricity                1.4.0
netbox.netbox                            3.16.0
ngine_io.cloudstack                      2.3.0
ngine_io.exoscale                        1.1.0
openstack.cloud                          2.2.0
openvswitch.openvswitch                  2.1.1
ovirt.ovirt                              3.2.0
purestorage.flasharray                   1.26.0
purestorage.flashblade                   1.15.0
purestorage.fusion                       1.6.0
sensu.sensu_go                           1.14.0
splunk.es                                2.1.2
t_systems_mms.icinga_director            2.0.1
telekom_mms.icinga_director              1.35.0
theforeman.foreman                       3.15.0
vmware.vmware_rest                       2.3.1
vultr.cloud                              1.12.1
vyos.vyos                                4.1.0
wti.remote                               1.0.5

# /usr/share/ansible/collections/ansible_collections
Collection                               Version
---------------------------------------- -------
checkmk.general                          5.2.1
theforeman.foreman                       4.0.0

To Reproduce
see above

Expected behavior
I expect that I can create and access folders in upper and lower case on OS level.

Actual behavior
I can create a folder on OS level in upper case but I cannot access the folder because the path is forced to be in lower case.

Minimum reproduction example
See above
Additional context
Not applicable

@mike1098 mike1098 added the bug Something isn't working label Sep 26, 2024
@github-actions github-actions bot added the module:folder This affects the folder module label Sep 26, 2024
@robin-checkmk robin-checkmk added feedback General feedback and removed bug Something isn't working labels Sep 26, 2024
@robin-checkmk robin-checkmk changed the title [BUG]Can cerate folder in upper case but cannot access the folder [FEED]Can create folder in upper case but cannot access the folder Sep 26, 2024
@robin-checkmk robin-checkmk added bug Something isn't working and removed feedback General feedback labels Sep 26, 2024
@robin-checkmk robin-checkmk changed the title [FEED]Can create folder in upper case but cannot access the folder [BUG]Can create folder in upper case but cannot access the folder Sep 26, 2024
@robin-checkmk
Copy link
Member

Checkmk forum link as a cross-reference.

In the forum the issue sounded more like a feedback topic, in a sense that a design decision is challenged.

This issue now makes it sound more like a bug, so we need to investigate first and then see, how to proceed.

@msekania
Copy link
Contributor

msekania commented Sep 26, 2024

@robin-checkmk,

there is a quick bug fix,

return str(p.parent).lower(), p.name

one should only remove .lower() and that's it.

have tested already.

@robin-checkmk
Copy link
Member

@msekania you want to do the honours of creating a PR, or should we do it?

@msekania
Copy link
Contributor

@robin-checkmk,

It's just a single line, I do not mind if you directly do the changes in develop branch

@robin-checkmk
Copy link
Member

Pushed the fix: fbcd840

@mike1098 can you install the collection from the devel branch directly and test the fix? If I understood correctly, you are still testing Ansible, so there is little risk, right? The devel branch is also still almost the same as the last release, as all changes are still in feature branches.

@mike1098
Copy link
Author

Pushed the fix: fbcd840

@mike1098 can you install the collection from the devel branch directly and test the fix? If I understood correctly, you are still testing Ansible, so there is little risk, right? The devel branch is also still almost the same as the last release, as all changes are still in feature branches.

I am currently testing site integration. Please let me finish this first. I hope I will be able t test devel next Tuesday.

@robin-checkmk robin-checkmk mentioned this issue Sep 30, 2024
7 tasks
@mike1098
Copy link
Author

mike1098 commented Sep 30, 2024

Pushed the fix: fbcd840
@mike1098 can you install the collection from the devel branch directly and test the fix? If I understood correctly, you are still testing Ansible, so there is little risk, right? The devel branch is also still almost the same as the last release, as all changes are still in feature branches.

I am currently testing site integration. Please let me finish this first. I hope I will be able t test devel next Tuesday.

I tested devel branch OK with following folder structure:


.
└── local_monitoring
    └── DE
        └── AUG
            ├── INDUSTRIAL
            ├── NETWORK
            ├── PRINTERS
            ├── SERVER
            └── STORAGE


@robin-checkmk robin-checkmk added the release:5.3.0 Affects the mentioned release. label Sep 30, 2024
@robin-checkmk
Copy link
Member

Marvelous! Then the fix will be released with version 5.3.0 which we are currently preparing for release.

@mike1098
Copy link
Author

Will it also contain pull request from Lars #654 Distri Sites?

@robin-checkmk
Copy link
Member

Will it also contain pull request from Lars #654 Distri Sites?

The release is currently being prepared here: #667
The scope can still change, but we are currently planning on including all the new feature PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:folder This affects the folder module release:5.3.0 Affects the mentioned release.
Projects
None yet
Development

No branches or pull requests

3 participants