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

dirtree should not modify the inputs #8

Open
dhs-rec opened this issue Jan 11, 2017 · 1 comment
Open

dirtree should not modify the inputs #8

dhs-rec opened this issue Jan 11, 2017 · 1 comment

Comments

@dhs-rec
Copy link

dhs-rec commented Jan 11, 2017

Given the following example class:

class dirtree_test {
  $tree = dirtree('D:/foo/bar/baz')
  file { $tree:
    ensure => directory,
  }
}

When applied to a Windows node, it leads to the following output:

Notice: /Stage[main]/Dirtree_test/File[D:\foo]/ensure: created
Notice: /Stage[main]/Dirtree_test/File[D:\foo\bar]/ensure: created
Notice: /Stage[main]/Dirtree_test/File[D:\foo\bar\baz]/ensure: created

Which means that dirtree modifies its input. This should not happen. It's perfectly fine on Windows to use '/' as a path separator. There's no need to replace '/' with '\\'.

@binford2k
Copy link

I tend to agree with you, but there are some certain edge cases in which the \ separator is required. For example scheduled tasks or DSC resources. I'm not certain those edge cases matter in this context, so I'll consider making this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants