Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4884

PMT won't install a module on windows if module_working_dir contains backslashes

    Details

    • Type: Bug
    • Status: Ready for Engineering
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PMT, Windows
    • Labels:
    • Template:
    • Team:
      Puppet Developer Experience

      Description

      If you override module_working_dir using a native windows path with backslashes, the PMT will fail to install the module, because it expects the path to contain forward slashes:

      C:\work\puppet [stable +25 ~0 -0 !]> bundle exec puppet module install puppetlabs-stdlib --module_working_dir C:\Windows\Temp --debug
      ...
      Error: Could not install package
        Package attempted to install file into
        "C:/Windows/Temp/cache/tmp-unpacker20150714-3276-hqzekd/puppetlabs-stdlib-4.6.0" under "C:\\Windows\\Temp/cache/tmp-unpacker20150714-3276-hqzekd".
      

      Changing that to forward slashes works, including if the case doesn't match:

      C:\work\puppet [stable +25 ~0 -0 !]> bundle exec puppet module install puppetlab
      s-stdlib --module_working_dir C:/windows/temp --debug
      ...
      Debug: Extracting: C:/windows/temp/cache/tmp-unpacker20150714-2640-1mynaxp/puppe
      tlabs-stdlib-4.6.0/lib/facter/util/puppet_settings.rb
      Notice: Installing -- do not interrupt ...
      C:/ProgramData/PuppetLabs/code/modules
      └── puppetlabs-stdlib (v4.6.0)
      

      A simple fix would be to ensure we call File.expand_path on whatever value is specified, as that canonicalizes the path (from ruby's perspective):

      C:\work\puppet [stable +25 ~0 -0 !]> irb
      irb(main):001:0> File.expand_path('C:\Windows\Temp')
      => "C:/Windows/Temp"
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  josh Josh Cooper
                  QA Contact:
                  Eric Thompson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Zendesk Support