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

(PDK-739) Fall back to default template if necessary #400

Merged
merged 2 commits into from
Jan 9, 2018

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Jan 8, 2018

Checks if the repo pointed to by the saved template-url from the answer file contains valid refs and fall back if it doesn't. git ls-remote will return non-zero (or specifically 2) if the remote does not exist or does not contain the specified ref (if supplied).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.219% when pulling ace5f8a on rodjek:pdk-739 into 1633768 on puppetlabs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.222% when pulling 10a5785 on rodjek:pdk-739 into 1633768 on puppetlabs:master.

@bmjen
Copy link
Contributor

bmjen commented Jan 9, 2018

@rodjek I've pushed an update to prevent the warning from getting spammed during a module creation b/c 'default_template_url' is called a few times.

[~/proj/sdk/test_modules]$ pdk new module foo
pdk (WARN): Unable to access the previously used template 'http://github.com/mjen/pdk-templates', using the default template instead.
pdk (WARN): Unable to access the previously used template 'http://github.com/mjen/pdk-templates', using the default template instead.
pdk (WARN): Unable to access the previously used template 'http://github.com/mjen/pdk-templates', using the default template instead.
pdk (WARN): Unable to access the previously used template 'http://github.com/mjen/pdk-templates', using the default template instead.
pdk (WARN): Unable to access the previously used template 'http://github.com/mjen/pdk-templates', using the default template instead.
pdk (WARN): Unable to access the previously used template 'http://github.com/mjen/pdk-templates', using the default template instead.
pdk (INFO): Creating new module: foo

I've modified it to update the answers file to remove the template-url the first time we detect an invalid url.

This is the new output.

[~/proj/sdk/test_modules]$ pdk new module foo
pdk (WARN): Unable to access the previously used template 'http://github.com/mjen/pdk-templates', using the default template instead.
pdk (INFO): Creating new module: foo
``

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 93.129% when pulling 3a041f4 on rodjek:pdk-739 into 1633768 on puppetlabs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.222% when pulling 64a10ca on rodjek:pdk-739 into 1633768 on puppetlabs:master.

@rodjek rodjek merged commit 89fb414 into puppetlabs:master Jan 9, 2018
@rodjek rodjek deleted the pdk-739 branch January 9, 2018 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants