Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1556

`pdk new class` doesn't place files based on module root

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PDK 1.16.0
    • None
    • None
    • Hide
      • When run from inside a module but deeper than the module root, `pdk new class` (and all other PDK object generators) should generate files in a location based on the module root, rather than relative to where the command was executed from.
      Show
      When run from inside a module but deeper than the module root, `pdk new class` (and all other PDK object generators) should generate files in a location based on the module root, rather than relative to where the command was executed from.
    • Puppet Developer Experience
    • Customer Feedback
    • Bug Fix
    • Hide
      Object generators (like 'pdk new class', 'pdk new defined_type', etc) will now operate as if run from the module root, regardless of what directory the user is in when the command is run. For example, this means that if a user runs `pdk new class` while within a module's 'spec' directory, the new class will be correctly generated in the module's 'manifests' directory.
      Show
      Object generators (like 'pdk new class', 'pdk new defined_type', etc) will now operate as if run from the module root, regardless of what directory the user is in when the command is run. For example, this means that if a user runs `pdk new class` while within a module's 'spec' directory, the new class will be correctly generated in the module's 'manifests' directory.
    • Needs Assessment

    Description

      From stephen:

      If "pdk new class" is run from within the manifests/ directory, it should realize it is inside a module (which it does, because it doesn't give the "inside valid module" error) and do the right thing (which it doesn't).  Currently, if you run "pdk new class" from inside <module>/manifests, it will create new manifests/ and spec/classes/ directories inside the existing manifests/ directory (manifests/manifests/<class>.pp and manifests/spec/classes/<class>_spec.rb).  The expected result would be for it to create the class.pp in the existing manifests/ directory and the <class>_spec.rb file in ../spec/classes/

      Attachments

        Issue Links

          Activity

            People

              glenn.sarti Glenn Sarti
              jesse Jesse Scott
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support