Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
allocbench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Fischer
allocbench
Commits
1f1361a3
Commit
1f1361a3
authored
Dec 13, 2019
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
fix facter bugs found by pylint
parent
0e62d8c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/facter.py
+9
-9
9 additions, 9 deletions
src/facter.py
with
9 additions
and
9 deletions
src/facter.py
+
9
−
9
View file @
1f1361a3
...
...
@@ -23,10 +23,10 @@ import json
import
multiprocessing
import
os
import
platform
import
subp
rocess
from
subprocess
import
CalledP
rocess
Error
import
src.globalvars
as
gv
from
src.util
import
print_
error
,
print_info
,
run_cmd
from
src.util
import
print_
debug
,
print_info
,
print_warn
,
run_cmd
FACTS
=
{}
...
...
@@ -73,12 +73,13 @@ def load_facts(path=None):
filename
=
"
facts
"
else
:
if
os
.
path
.
isdir
(
path
):
filename
=
os
.
path
.
join
(
path
,
self
.
name
)
filename
=
os
.
path
.
join
(
path
,
"
facts
"
)
else
:
filename
=
os
.
path
.
splitext
(
path
)[
0
]
if
os
.
path
.
exists
(
filename
+
"
.json
"
):
filename
+=
"
.json
"
global
FACTS
with
open
(
filename
,
"
r
"
)
as
f
:
FACTS
=
json
.
load
(
f
)
elif
os
.
path
.
exists
(
filename
+
"
.save
"
):
...
...
@@ -167,12 +168,11 @@ def libc_ver(executable=None):
def
exe_version
(
executable
,
version_flag
=
"
--version
"
):
"""
Return version of executable
"""
proc
=
subprocess
.
run
([
executable
,
version_flag
],
universal_newlines
=
True
,
stdout
=
subprocess
.
PIPE
)
if
proc
.
returncode
!=
0
:
print_warning
(
f
"
failed to get version of
{
executable
}
"
)
try
:
proc
=
run_cmd
([
executable
,
version_flag
],
capture
=
True
)
except
CalledProcessError
as
e
:
print_warn
(
f
"
failed to get version of
{
executable
}
"
)
print_debug
(
e
.
stderr
)
return
""
return
proc
.
stdout
[:
-
1
]
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