Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Holland Computing Center
chipathlon
Commits
4e3a45df
Commit
4e3a45df
authored
Jul 06, 2017
by
Natasha Pavlovikj
Browse files
Add condition to check if file is empty before uploading it to MongoDB
parent
aef122dc
Changes
1
Show whitespace changes
Inline
Side-by-side
scripts/chip-job-save-result
View file @
4e3a45df
...
...
@@ -12,7 +12,7 @@ parser.add_argument("-f", "--file", dest="file", required=True, help="Path to re
parser
.
add_argument
(
"-m"
,
"--meta"
,
dest
=
"meta"
,
required
=
True
,
help
=
"Path to meta yaml file."
)
args
=
parser
.
parse_args
()
if
os
.
path
.
isfile
(
args
.
file
)
and
os
.
path
.
isfile
(
args
.
meta
):
if
os
.
path
.
isfile
(
args
.
file
)
and
os
.
path
.
isfile
(
args
.
meta
)
and
os
.
path
.
getsize
(
args
.
file
)
>
0
:
mdb
=
chipathlon
.
db
.
MongoDB
(
args
.
host
,
args
.
username
,
args
.
password
)
with
open
(
args
.
meta
,
"r"
)
as
rh
:
meta
=
yaml
.
load
(
rh
)
...
...
Write
Preview
Supports
Markdown
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