Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
puppet-freeradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Projets publics
puppet-freeradius
Commits
a2e1f94c
Commit
a2e1f94c
authored
9 years ago
by
Jonathan Gazeley
Browse files
Options
Downloads
Patches
Plain Diff
Combine two facts into one, to share the same exec
parent
8c7e6214
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/facter/freeradius_maj_version.rb
+0
-13
0 additions, 13 deletions
lib/facter/freeradius_maj_version.rb
lib/facter/freeradius_version.rb
+15
-6
15 additions, 6 deletions
lib/facter/freeradius_version.rb
with
15 additions
and
19 deletions
lib/facter/freeradius_maj_version.rb
deleted
100644 → 0
+
0
−
13
View file @
8c7e6214
# Grab the FreeRADIUS version from the output of radiusd -v
Facter
.
add
(
:freeradius_maj_version
)
do
setcode
do
version
=
Facter
::
Core
::
Execution
.
exec
(
'radiusd -v'
)
if
version
.
nil?
version
=
Facter
::
Core
::
Execution
.
exec
(
'freeradius -v'
)
end
if
!
version
.
nil?
version
=
version
.
split
(
/\n/
)[
0
].
match
(
/FreeRADIUS Version (\d)\.\d\.\d/
)[
1
].
to_s
end
version
end
end
This diff is collapsed.
Click to expand it.
lib/facter/freeradius_version.rb
+
15
−
6
View file @
a2e1f94c
# Grab the FreeRADIUS version from the output of radiusd -v
Facter
.
add
(
:freeradius_version
)
do
setcode
do
version
=
Facter
::
Core
::
Execution
.
exec
(
'radiusd -v'
)
if
version
.
nil?
version
=
Facter
::
Core
::
Execution
.
exec
(
'freeradius -v'
)
end
Facter
.
add
(
:freeradius_version
)
do
setcode
do
if
!
version
.
nil?
ver
sion
=
version
.
split
(
/\n/
)[
0
].
match
(
/FreeRADIUS Version (\d\.\d\.\d)/
)[
1
].
to_s
min
ver
=
version
.
split
(
/\n/
)[
0
].
match
(
/FreeRADIUS Version (\d\.\d\.\d)/
)[
1
].
to_s
end
ver
sion
min
ver
end
end
Facter
.
add
(
:freeradius_maj_version
)
do
setcode
do
if
!
version
.
nil?
majver
=
version
.
split
(
/\n/
)[
0
].
match
(
/FreeRADIUS Version (\d)\.\d\.\d/
)[
1
].
to_s
end
majver
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment