-
Notifications
You must be signed in to change notification settings - Fork 465
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
apt::setting: Parse type and name from title. #444
Conversation
ce4ed56
to
75487c1
Compare
$setting_type = $title_array[0] | ||
$base_name = join(delete_at($title_array, 0), '-') | ||
|
||
validate_re($setting_type, ['^conf', '^pref', '^list'], "apt::setting resource name/title must start with either 'conf-', 'pref-' or 'list-'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these be ^conf$, ^pref$ and ^list$?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn it 😝.
75487c1
to
c67798c
Compare
@@ -31,8 +31,6 @@ | |||
} | |||
|
|||
apt::setting { 'conf-update-stamp': | |||
base_name => 'update-stamp', | |||
setting_type => 'conf', | |||
priority => 15, | |||
content => template('apt/_header.erb', 'apt/15update-stamp.erb'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra spaces before =>
Instead of having two additional parameters, `base_name` and `setting_type` simply parse it from `title`. We need to prefix most resources with `list-`, `conf-`, or `pref-` any way to avoid duplicate resources so we might as well leverage that.
c67798c
to
d261d8f
Compare
apt::setting: Parse type and name from title.
Instead of having two additional parameters,
base_name
andsetting_type
simply parse it fromtitle
.We need to prefix most resources with
list-
,conf-
, orpref-
any way to avoid duplicate resources so we might as well leverage that.