[PDK-1041] Updating over the pdk-module-templates renaming fails Created: 2018/06/19  Updated: 2018/08/07  Resolved: 2018/07/16

Status: Closed
Project: Puppet Development Kit
Component/s: None
Affects Version/s: PDK 1.6.0
Fix Version/s: PDK 1.6.1

Type: Bug Priority: Normal
Reporter: David Schmitt Assignee: Tim Sharpe
Resolution: Fixed Votes: 0
Labels: resolved-issue-added
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
is duplicated by PDK-745 Failing to create a new module with f... Resolved
Method Found: Needs Assessment
Release Notes: Bug Fix
Release Notes Summary: A proper error message is now displayed if updating a module and the template does not exist.
QA Risk Assessment: Needs Assessment


The PDK should detect old versions of the cached template-url and update those automatically to pdk-templates

david@davids:~/git/david-testmod$ pdk update --force
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/lib/pdk/module/templatedir.rb:189:in `validate_module_template!': The specified template 'file:///opt/puppetlabs/pdk/share/cache/pdk-module-template.git' is not a directory. (ArgumentError)
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/lib/pdk/module/templatedir.rb:59:in `initialize'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/lib/pdk/module/convert.rb:71:in `new'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/lib/pdk/module/convert.rb:71:in `stage_changes!'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/lib/pdk/module/update.rb:9:in `run'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/lib/pdk/cli/update.rb:29:in `block (2 levels) in <module:CLI>'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:329:in `run_this'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:269:in `run'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in `run'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/lib/pdk/cli.rb:18:in `run'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.6.0.pre/exe/pdk:6:in `<top (required)>'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/bin/pdk:23:in `load'
	from /opt/puppetlabs/pdk/private/ruby/2.4.4/bin/pdk:23:in `<main>'
david@davids:~/git/david-testmod$ ls -la /opt/puppetlabs/pdk/share/cache/pdk-module-template.git
ls: cannot access '/opt/puppetlabs/pdk/share/cache/pdk-module-template.git': No such file or directory
david@davids:~/git/david-testmod$ ls -la /opt/puppetlabs/pdk/share/cache/
total 48
drwxr-xr-x 4 root root 4096 Jun 11 09:57 .
drwxr-xr-x 8 root root 4096 Nov  1  2017 ..
-rw-r--r-- 1 root root 4358 Jun  7 02:01 Gemfile-2.1.9.lock
-rw-r--r-- 1 root root 4348 Jun  7 02:01 Gemfile-2.4.4.lock
-rw-r--r-- 1 root root 4348 Jun  7 02:01 Gemfile.lock
drwxr-xr-x 7 root root 4096 Jun 11 09:57 pdk-templates.git
-rw-r--r-- 1 root root 3876 Jun  7 01:57 pe_versions.json
drwxr-xr-x 4 root root 4096 Apr  9 15:15 ruby
-rw-r--r-- 1 root root 2100 Jun  7 01:57 task.json
david@davids:~/git/david-testmod$ pdk --version
1.6.0.pre (47)

Comment by Bryan Jen [ 2018/06/27 ]

This should be addressed in two different ways.

1) PDK should handle the `file not found` exception for a template-url that is on local disk and report that generic error to the user.
2) PDK should detect that the local file path is in the private PDK cache, and report a specific error that advises that the built-in template has changed and advise the user to run pdk convert.

Generated at Wed Nov 20 22:49:21 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.