Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
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
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
ea346881
Commit
ea346881
authored
Sep 11, 2018
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L1C product population
parent
f92053cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
populate_products_l1c.py
catalog/management/commands/populate_products_l1c.py
+4
-2
No files found.
catalog/management/commands/populate_products_l1c.py
View file @
ea346881
...
...
@@ -59,7 +59,7 @@ class Command(BaseCommand):
ssh
.
connect
(
SSH_ADDRESS
,
username
=
SSH_USERNAME
)
ssh_stdin
,
ssh_stdout
,
ssh_stderr
=
ssh
.
exec_command
(
SSH_COMMAND
)
path
=
ssh_stdout
.
read
()
.
replace
(
"
\n
"
,
''
)
sftp
=
ssh
.
open_sftp
()
## Creates SFTPClient() object
sftp
.
chdir
(
path
)
file_list
=
sftp
.
listdir
()
...
...
@@ -70,6 +70,8 @@ class Command(BaseCommand):
PRODUCT_EXISTS
=
Product_l1c
.
objects
.
filter
(
identifier
=
file_name
)
.
exists
()
if
not
PRODUCT_EXISTS
:
file_path
=
path
+
"/"
+
file
try
:
data_dict
=
self
.
generate_json
(
file_name
)
# print json.dumps(data_dict, indent=3, sort_keys=True, default=str)
...
...
@@ -77,7 +79,7 @@ class Command(BaseCommand):
product_l1c
=
Product_l1c
(
uuid
=
data_dict
[
'id'
],
identifier
=
data_dict
[
'Identifier'
],
file_path
=
path
,
file_path
=
file_
path
,
json
=
json
.
dumps
(
data_dict
,
indent
=
3
,
sort_keys
=
True
,
ensure_ascii
=
True
,
default
=
str
)
)
...
...
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