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

'systemctl daemon-reload' is not qualified #22

Closed
craiggenner opened this issue Feb 23, 2017 · 4 comments
Closed

'systemctl daemon-reload' is not qualified #22

craiggenner opened this issue Feb 23, 2017 · 4 comments

Comments

@craiggenner
Copy link

craiggenner commented Feb 23, 2017

When importing this module and then running spec tests I get the following:

Failure/Error: it { should compile.with_all_deps }
  error during compilation: Validation of Exec[systemctl-daemon-reload] failed: 'systemctl daemon-reload' is not qualified and no path was specified. Please qualify the command or specify a path. at /mnt/spec/fixtures/modules/systemd/manifests/init.pp:11

The fix appears to be to change:

  Exec {
    refreshonly => true,
    path        => $::path,
  }

to:

  Exec {
    refreshonly => true,
    path        => split($::path, ':'),
  }

Not sure if this breaks other things though.

@alexjfisher
Copy link
Member

It should be fine either way.
https://docs.puppet.com/puppet/latest/types/exec.html#exec-attribute-path

Paths can be specified as an array or as a ‘:’ separated list.

@craiggenner What does your $::path fact look like?

@craiggenner
Copy link
Author

I would agree that it should be fine either way, but I couldn't get the tests to pass until I tried it with a split.

I'm not working in that environment any more so I'm not able to say what $::path is, but I should be doing something similar soon so I'll test again and let you know the results.

@raphink
Copy link
Member

raphink commented May 18, 2017

Are you still able to reproduce this?

@TheMeier
Copy link
Contributor

TheMeier commented Sep 8, 2017

@craiggenner this is a topic with many modules. I think there is an argument here that your test setup is incomplete. I am running all of my tests using https://github.com/mcanevet/rspec-puppet-facts nowadays for that reason. path is certainly not the only fact you want to have pre-set.

@raphink raphink closed this as completed Jul 15, 2020
op-ct pushed a commit to op-ct/puppet-systemd that referenced this issue Jun 17, 2022
Bump min version_requirement for Puppet + deps
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

4 participants