Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flex Extract
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Flexpart
Flex Extract
Commits
6cda7c1b
Commit
6cda7c1b
authored
6 years ago
by
Anne Philipp
Browse files
Options
Downloads
Patches
Plain Diff
moved check install coditions to install module
parent
2d56c04d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/python/_config.py
+2
-0
2 additions, 0 deletions
source/python/_config.py
source/python/classes/ControlFile.py
+0
-46
0 additions, 46 deletions
source/python/classes/ControlFile.py
source/python/install.py
+52
-1
52 additions, 1 deletion
source/python/install.py
with
54 additions
and
47 deletions
source/python/_config.py
+
2
−
0
View file @
6cda7c1b
...
...
@@ -31,6 +31,8 @@ _VERSION_STR = '7.1'
QUEUES_LIST
=
[
'
ecgate
'
,
'
cca
'
,
'
ccb
'
]
INSTALL_TARGETS
=
[
'
local
'
,
'
ecgate
'
,
'
cca
'
]
# up-to-date available maximum level numbers at ECMWF, 05.10.2018
MAX_LEVEL_LIST
=
[
16
,
19
,
31
,
40
,
50
,
60
,
62
,
91
,
137
]
...
...
This diff is collapsed.
Click to expand it.
source/python/classes/ControlFile.py
+
0
−
46
View file @
6cda7c1b
...
...
@@ -503,52 +503,6 @@ class ControlFile(object):
return
def
check_install_conditions
(
self
):
'''
Checks a couple of necessary attributes and conditions
for the installation such as if they exist and contain values.
Otherwise set default values.
Parameters
----------
Return
------
'''
if
self
.
install_target
and
\
self
.
install_target
not
in
[
'
local
'
,
'
ecgate
'
,
'
cca
'
]:
print
(
'
ERROR: unknown or missing installation target
'
)
print
(
'
target:
'
,
self
.
install_target
)
print
(
'
please specify correct installation target
'
+
'
(local | ecgate | cca)
'
)
print
(
'
use -h or --help for help
'
)
sys
.
exit
(
1
)
if
self
.
install_target
and
self
.
install_target
!=
'
local
'
:
if
not
self
.
ecgid
or
not
self
.
ecuid
or
\
not
self
.
gateway
or
not
self
.
destination
:
print
(
'
Please enter your ECMWF user id and group id as well
'
+
'
as the
\n
name of the local gateway and the ectrans
'
+
'
destination
'
)
print
(
'
with command line options --ecuid --ecgid
\
--gateway --destination
'
)
print
(
'
Try
"'
+
sys
.
argv
[
0
].
split
(
'
/
'
)[
-
1
]
+
\
'
-h
"
to print usage information
'
)
print
(
'
Please consult ecaccess documentation or ECMWF user
\
support for further details
'
)
sys
.
exit
(
1
)
if
not
self
.
flexpart_root_scripts
:
self
.
flexpart_root_scripts
=
'
${HOME}
'
else
:
self
.
flexpart_root_scripts
=
self
.
flexpart_root_scripts
else
:
# local
if
not
self
.
flexpart_root_scripts
:
self
.
flexpart_root_scripts
=
_config
.
PATH_FLEXEXTRACT_DIR
return
def
to_list
(
self
):
'''
Just generates a list of strings containing the attributes and
assigned values except the attributes
"
_expanded
"
,
"
exedir
"
,
...
...
This diff is collapsed.
Click to expand it.
source/python/install.py
+
52
−
1
View file @
6cda7c1b
...
...
@@ -79,7 +79,7 @@ def main():
args
=
get_install_cmdline_arguments
()
c
=
ControlFile
(
args
.
controlfile
)
c
.
assign_args_to_control
(
args
)
c
.
check_install_conditions
()
check_install_conditions
(
c
)
install_via_gateway
(
c
)
...
...
@@ -218,6 +218,57 @@ def install_via_gateway(c):
return
def
check_install_conditions
(
c
):
'''
Checks a couple of necessary attributes and conditions
for the installation such as if they exist and contain values.
Otherwise set default values.
Parameters
----------
c : :obj:`ControlFile`
Contains all the parameters of CONTROL file and
command line.
Return
------
'''
if
c
.
install_target
and
\
c
.
install_target
not
in
_config
.
INSTALL_TARGETS
:
print
(
'
ERROR: unknown or missing installation target
'
)
print
(
'
target:
'
,
c
.
install_target
)
print
(
'
please specify correct installation target
'
+
str
(
INSTALL_TARGETS
))
print
(
'
use -h or --help for help
'
)
sys
.
exit
(
1
)
if
c
.
install_target
and
c
.
install_target
!=
'
local
'
:
if
not
c
.
ecgid
or
not
c
.
ecuid
or
\
not
c
.
gateway
or
not
c
.
destination
:
print
(
'
Please enter your ECMWF user id and group id as well
'
+
'
as the
\n
name of the local gateway and the ectrans
'
+
'
destination
'
)
print
(
'
with command line options --ecuid --ecgid
\
--gateway --destination
'
)
print
(
'
Try
"'
+
sys
.
argv
[
0
].
split
(
'
/
'
)[
-
1
]
+
\
'
-h
"
to print usage information
'
)
print
(
'
Please consult ecaccess documentation or ECMWF user
\
support for further details
'
)
sys
.
exit
(
1
)
if
not
c
.
flexpart_root_scripts
:
c
.
flexpart_root_scripts
=
'
${HOME}
'
else
:
c
.
flexpart_root_scripts
=
c
.
flexpart_root_scripts
else
:
# local
if
not
c
.
flexpart_root_scripts
:
c
.
flexpart_root_scripts
=
_config
.
PATH_FLEXEXTRACT_DIR
return
def
mk_tarball
(
tarball_path
,
target
):
'''
Creates a tarball with all necessary files which need to be sent to the
installation directory.
...
...
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