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

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.16.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      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.
    • Team:
      Puppet Developer Experience
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      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.
    • QA Risk Assessment:
      Needs Assessment

      Description

      From Stephen Potter:

      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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support