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

package name collisions in chocolatey state #41185

Closed
jmarinaro opened this issue May 11, 2017 · 1 comment
Closed

package name collisions in chocolatey state #41185

jmarinaro opened this issue May 11, 2017 · 1 comment
Labels
Bug broken, incorrect, or confusing behavior Platform Relates to OS, containers, platform-based utilities like FS, system based apps
Milestone

Comments

@jmarinaro
Copy link
Contributor

Description of Issue/Question

Due to the way the installed test is run in the chocolatey state, packages can show they're installed when they're not and also not match when case is different in the state from the package name.

Setup

GoogleChrome.Dev:
  chocolatey.installed: []

choco_list:
  module.run:
    - name: chocolatey.list
    - local_only: True

googlechrome.dev:
  chocolatey.installed: []

choco_list_2:
  module.run:
    - name: chocolatey.list
    - local_only: True

GoogleChrome:
  chocolatey.installed: []

choco_list_3:
  module.run:
    - name: chocolatey.list
    - local_only: True

results in

# salt 'vagrant-2012-r2' state.sls test saltenv=choco
vagrant-2012-r2:
----------
          ID: GoogleChrome.Dev
    Function: chocolatey.installed
      Result: True
     Comment: The Package GoogleChrome.Dev is already installed
     Started: 17:33:50.599000
    Duration: 1000.0 ms
     Changes:
----------
          ID: choco_list
    Function: module.run
        Name: chocolatey.list
      Result: True
     Comment: Module function chocolatey.list executed
     Started: 17:33:51.599000
    Duration: 1031.0 ms
     Changes:
              ----------
              ret:
                  ----------
                  GoogleChrome.Dev:
                      - 27.0.1453.12
                  chocolatey:
                      - 0.10.5
                  chocolatey-core.extension:
                      - 1.3.0
                  saltminion:
                      - 2016.11.4
                  vcredist2008:
                      - 9.0.30729.6161
----------
          ID: googlechrome.dev
    Function: chocolatey.installed
      Result: True
     Comment:
     Started: 17:33:52.630000
    Duration: 2407.0 ms
     Changes:
              ----------
              googlechrome.dev:
                  Chocolatey v0.10.5
                  Installing the following packages:
                  googlechrome.dev
                  By installing you accept licenses for the packages.
                  GoogleChrome.Dev v27.0.1453.12 already installed.
                   Use --force to reinstall, specify a version to install, or try upgrade.

                  Chocolatey installed 0/1 packages. 0 packages failed.
                   See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

                  Warnings:
                   - googlechrome.dev - GoogleChrome.Dev v27.0.1453.12 already installed.
                   Use --force to reinstall, specify a version to install, or try upgrade.
----------
          ID: choco_list_2
    Function: module.run
        Name: chocolatey.list
      Result: True
     Comment: Module function chocolatey.list executed
     Started: 17:33:55.037000
    Duration: 952.0 ms
     Changes:
              ----------
              ret:
                  ----------
                  GoogleChrome.Dev:
                      - 27.0.1453.12
                  chocolatey:
                      - 0.10.5
                  chocolatey-core.extension:
                      - 1.3.0
                  saltminion:
                      - 2016.11.4
                  vcredist2008:
                      - 9.0.30729.6161
----------
          ID: GoogleChrome
    Function: chocolatey.installed
      Result: True
     Comment: The Package GoogleChrome is already installed
     Started: 17:33:55.989000
    Duration: 954.0 ms
     Changes:
----------
          ID: choco_list_3
    Function: module.run
        Name: chocolatey.list
      Result: True
     Comment: Module function chocolatey.list executed
     Started: 17:33:56.943000
    Duration: 985.0 ms
     Changes:
              ----------
              ret:
                  ----------
                  GoogleChrome.Dev:
                      - 27.0.1453.12
                  chocolatey:
                      - 0.10.5
                  chocolatey-core.extension:
                      - 1.3.0
                  saltminion:
                      - 2016.11.4
                  vcredist2008:
                      - 9.0.30729.6161

Summary for vagrant-2012-r2
------------
Succeeded: 6 (changed=4)
Failed:    0
------------
Total states run:     6
Total run time:   7.329 s

The first chocolatey.installed state is to ensure GoogleChrome.Dev is installed, the second tests a case where the state doesn't match the case of the chocolatey package, and the third tests when the package is a substring of an already installed package.

Steps to Reproduce Issue

Base install with chocolatey and salt-minion.

Versions Report

minion is on a server 2012r2 core vagrant box with 2016.11.4 and chocolatey 0.10.5

# salt --versions-report
Salt Version:
           Salt: 2016.11.4

Dependency Versions:
           cffi: 1.9.1
       cherrypy: unknown
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: 2.0.0
      gitpython: 2.1.1
          ioflo: Not Installed
         Jinja2: 2.9.5
        libgit2: 0.24.5
        libnacl: Not Installed
       M2Crypto: 0.24.0
           Mako: 1.0.6
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.24.2
         Python: 2.7.13 (default, Jan 19 2017, 14:48:08)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.1
        timelib: Not Installed
        Tornado: 4.4.2
            ZMQ: 4.2.1

System Versions:
           dist: Ubuntu 17.04 zesty
        machine: x86_64
        release: 4.10.0-20-generic
         system: Linux
        version: Ubuntu 17.04 zesty```
@gtmanfred
Copy link
Contributor

Thanks for the PR to fix this!
Daniel

@gtmanfred gtmanfred added Bug broken, incorrect, or confusing behavior Platform Relates to OS, containers, platform-based utilities like FS, system based apps labels May 11, 2017
@gtmanfred gtmanfred added this to the Approved milestone May 11, 2017
jmarinaro added a commit to jmarinaro/salt that referenced this issue May 11, 2017
jmarinaro added a commit to jmarinaro/salt that referenced this issue May 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Platform Relates to OS, containers, platform-based utilities like FS, system based apps
Projects
None yet
Development

No branches or pull requests

2 participants