Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.core
Commits
9964c960
Commit
9964c960
authored
Jul 08, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master', remote branch 'origin' into slave_instance
parents
07d32c9f
6e8579dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
13 deletions
+54
-13
master/tests/__init__.py
master/tests/__init__.py
+18
-0
slapos/console.py
slapos/console.py
+35
-12
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+1
-1
No files found.
master/tests/__init__.py
View file @
9964c960
from
test_suite
import
SavedTestSuite
,
ProjectTestSuite
class
VIFIB
(
SavedTestSuite
,
ProjectTestSuite
):
_bt_list
=
[
'erp5_configurator_vifib'
,
'vifib_base'
,
'vifib_core'
,
'vifib_crm'
,
'vifib_data'
,
'vifib_data_category'
,
'vifib_data_web'
,
'vifib_erp5'
,
'vifib_forge_release'
,
'vifib_l10n_fr'
,
'vifib_mysql_innodb_catalog'
,
'vifib_open_trade'
,
'vifib_slap'
,
'vifib_software_pdm'
,
'vifib_upgrader'
,
'vifib_web'
,
]
_product_list
=
[
'Vifib'
]
_saved_test_id
=
'Products.Vifib.tests.VifibMixin'
slapos/console.py
View file @
9964c960
...
...
@@ -29,6 +29,7 @@ import slapos.slap.slap
from
slapos.slap
import
ResourceNotReady
import
sys
import
os
from
optparse
import
OptionParser
,
Option
import
ConfigParser
...
...
@@ -61,6 +62,19 @@ class Parser(OptionParser):
(
options
,
args
)
=
self
.
parse_args
()
if
len
(
args
)
==
0
:
self
.
error
(
"Incorrect number of arguments"
)
elif
not
os
.
path
.
isfile
(
args
[
0
]):
self
.
error
(
"%s: Not found or not a regular file."
%
args
[
0
])
return
options
,
args
class
RequestParser
(
Parser
):
def
check_args
(
self
):
"""
Check arguments
"""
(
options
,
args
)
=
Parser
.
check_args
(
self
)
if
len
(
args
)
<
3
:
self
.
error
(
"Incorrect number of arguments"
)
return
options
,
args
...
...
@@ -77,16 +91,22 @@ class Config:
configuration_parser
=
ConfigParser
.
SafeConfigParser
()
configuration_parser
.
read
(
configuration_file_path
)
# Merges the arguments and configuration
for
section
in
(
"slapconsole"
,):
configuration_dict
=
dict
(
configuration_parser
.
items
(
section
))
for
key
in
configuration_dict
:
if
not
getattr
(
self
,
key
,
None
):
for
section
in
(
'slapos'
,
'slapconsole'
):
try
:
configuration_dict
=
dict
(
configuration_parser
.
items
(
section
))
except
ConfigParser
.
NoSectionError
:
pass
else
:
for
key
in
configuration_dict
:
setattr
(
self
,
key
,
configuration_dict
[
key
])
configuration_dict
=
dict
(
configuration_parser
.
items
(
'slapos'
))
setattr
(
self
,
'master_url'
,
configuration_dict
[
'master_url'
])
if
not
self
.
master_url
:
raise
ValueError
(
'master_url is required.'
)
master_url
=
getattr
(
self
,
'master_url'
,
None
)
if
not
master_url
:
raise
ValueError
(
"No option 'master_url'"
)
elif
master_url
.
startswith
(
'https'
)
and
\
not
getattr
(
self
,
'key_file'
,
None
)
and
\
not
getattr
(
self
,
'cert_file'
,
None
):
raise
ValueError
(
"No option 'key_file' and/or 'cert_file'"
)
def
init
(
config
):
...
...
@@ -98,7 +118,10 @@ def init(config):
local
=
globals
().
copy
()
local
[
'slap'
]
=
slap
# Create aliases as global variables
alias
=
config
.
alias
.
split
(
'
\
n
'
)
try
:
alias
=
config
.
alias
.
split
(
'
\
n
'
)
except
AttributeError
:
alias
=
[]
software_list
=
[]
for
software
in
alias
:
if
software
is
not
''
:
...
...
@@ -120,8 +143,8 @@ def request():
usage
=
"""usage: %s [options] CONFIGURATION_FILE SOFTWARE_INSTANCE INSTANCE_REFERENCE
slapos-request allows you to request slapos instances."""
%
sys
.
argv
[
0
]
config
=
Config
()
arguments
=
Parser
(
usage
=
usage
).
check_args
()[
1
]
config
.
setConfig
(
*
Parser
(
usage
=
usage
).
check_args
()
)
options
,
arguments
=
RequestParser
(
usage
=
usage
).
check_args
()
config
.
setConfig
(
options
,
arguments
[
0
]
)
local
=
init
(
config
)
...
...
slapos/grid/slapgrid.py
View file @
9964c960
...
...
@@ -623,7 +623,7 @@ class Slapgrid(object):
server_url
=
self
.
master_url
,
software_release_url
=
software_url
,
certificate_repository_path
=
self
.
certificate_repository_path
,
console
=
self
.
console
console
=
self
.
console
,
buildout
=
self
.
buildout
)
if
computer_partition
.
getState
()
==
"destroyed"
:
try
:
...
...
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