Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel393
Commits
b845cb77
Commit
b845cb77
authored
Nov 28, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scp to local then scan
parent
0efdded4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
check_versions.py
check_versions.py
+20
-1
No files found.
check_versions.py
View file @
b845cb77
...
@@ -62,6 +62,25 @@ def get_versions_from_target(addr,tdir):
...
@@ -62,6 +62,25 @@ def get_versions_from_target(addr,tdir):
return
remote_list
return
remote_list
def
get_versions_from_target_quick
(
addr
,
tdir
):
# print remote package list
ldir
=
os
.
path
.
basename
(
tdir
)
if
os
.
path
.
isdir
(
ldir
):
shout
(
"rm -rf "
+
ldir
)
shout
(
"scp -r "
+
addr
+
":"
+
tdir
+
" ."
)
remote_list
=
[]
for
f
in
os
.
listdir
(
ldir
):
with
open
(
ldir
+
"/"
+
f
,
'r'
)
as
content_file
:
content
=
content_file
.
read
()
remote_list
.
append
([
f
,
content
.
strip
()])
shout
(
"rm -rf "
+
ldir
)
return
remote_list
def
get_version_from_git
(
path
,
vfile
):
def
get_version_from_git
(
path
,
vfile
):
print
(
path
)
print
(
path
)
cwd
=
os
.
getcwd
()
cwd
=
os
.
getcwd
()
...
@@ -179,7 +198,7 @@ else:
...
@@ -179,7 +198,7 @@ else:
print
(
"Software/firmware versions check for target "
+
bcolors
.
BOLDWHITE
+
user
+
"@"
+
ip
+
bcolors
.
ENDC
)
print
(
"Software/firmware versions check for target "
+
bcolors
.
BOLDWHITE
+
user
+
"@"
+
ip
+
bcolors
.
ENDC
)
print
(
bcolors
.
BOLDWHITE
+
"=== Read versions from the target ==="
+
bcolors
.
ENDC
)
print
(
bcolors
.
BOLDWHITE
+
"=== Read versions from the target ==="
+
bcolors
.
ENDC
)
target_list
=
get_versions_from_target
(
user
+
"@"
+
ip
,
target_dir
)
target_list
=
get_versions_from_target
_quick
(
user
+
"@"
+
ip
,
target_dir
)
print
(
target_list
)
print
(
target_list
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment