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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
3a98bda4
Commit
3a98bda4
authored
Jan 22, 2025
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: revert everything!!!
parent
447d3da4
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
518 additions
and
5823 deletions
+518
-5823
slapos/cli/entry.py
slapos/cli/entry.py
+2
-2
slapos/cli/register.py
slapos/cli/register.py
+6
-23
slapos/cli/request.py
slapos/cli/request.py
+10
-38
slapos/cli/supply.py
slapos/cli/supply.py
+6
-19
slapos/format.py
slapos/format.py
+11
-50
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+18
-52
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+109
-303
slapos/grid/templates/buildout-tail.cfg.in
slapos/grid/templates/buildout-tail.cfg.in
+0
-9
slapos/grid/watchdog.py
slapos/grid/watchdog.py
+6
-26
slapos/manager/portredir.py
slapos/manager/portredir.py
+2
-1
slapos/slap/hateoas.py
slapos/slap/hateoas.py
+20
-51
slapos/slap/slap.py
slapos/slap/slap.py
+2
-3
slapos/tests/test_cli.py
slapos/tests/test_cli.py
+0
-1
slapos/tests/test_object.py
slapos/tests/test_object.py
+6
-13
slapos/tests/test_slapformat.py
slapos/tests/test_slapformat.py
+0
-78
slapos/tests/test_slapgrid.py
slapos/tests/test_slapgrid.py
+320
-584
slapos/tests/test_slapgrid_slaptool.py
slapos/tests/test_slapgrid_slaptool.py
+0
-4570
No files found.
slapos/cli/entry.py
View file @
3a98bda4
...
@@ -111,11 +111,11 @@ class SlapOSHelpAction(argparse.Action):
...
@@ -111,11 +111,11 @@ class SlapOSHelpAction(argparse.Action):
try
:
try
:
factory
=
ep
.
load
()
factory
=
ep
.
load
()
except
Exception
as
err
:
except
Exception
as
err
:
r
aise
r
eturn
'Could not load %r
\
n
'
%
ep
try
:
try
:
cmd
=
factory
(
self
,
None
)
cmd
=
factory
(
self
,
None
)
except
Exception
as
err
:
except
Exception
as
err
:
r
aise
r
eturn
'Could not instantiate %r: %s
\
n
'
%
(
ep
,
err
)
one_liner
=
cmd
.
get_description
().
split
(
'
\
n
'
)[
0
]
one_liner
=
cmd
.
get_description
().
split
(
'
\
n
'
)[
0
]
group
=
getattr
(
factory
,
'command_group'
,
'other'
)
group
=
getattr
(
factory
,
'command_group'
,
'other'
)
return
group
,
' %-13s %s
\
n
'
%
(
name
,
one_liner
)
return
group
,
' %-13s %s
\
n
'
%
(
name
,
one_liner
)
...
...
slapos/cli/register.py
View file @
3a98bda4
...
@@ -59,8 +59,6 @@ class RegisterCommand(Command):
...
@@ -59,8 +59,6 @@ class RegisterCommand(Command):
ap
=
super
(
RegisterCommand
,
self
).
get_parser
(
prog_name
)
ap
=
super
(
RegisterCommand
,
self
).
get_parser
(
prog_name
)
ap
.
add_argument
(
'node_name'
,
ap
.
add_argument
(
'node_name'
,
default
=
''
,
nargs
=
'?'
,
help
=
'Chosen title for the node'
)
help
=
'Chosen title for the node'
)
ap
.
add_argument
(
'--interface-name'
,
ap
.
add_argument
(
'--interface-name'
,
...
@@ -150,19 +148,6 @@ def get_certificate_key_pair(logger, master_url_web, node_name, token=None, logi
...
@@ -150,19 +148,6 @@ def get_certificate_key_pair(logger, master_url_web, node_name, token=None, logi
"""Download certificates from SlapOS Master"""
"""Download certificates from SlapOS Master"""
if
token
:
if
token
:
if
token
.
startswith
(
"V2/"
):
_
,
compute_node_id
,
token
=
token
.
split
(
"/"
)
data
=
{}
if
node_name
:
data
=
{
'title'
:
node_name
}
req
=
requests
.
post
(
'/'
.
join
([
master_url_web
.
strip
(
"/"
),
'compute_node_module/%s/ComputeNode_approveComputer'
%
compute_node_id
]),
data
=
data
,
headers
=
{
'X-Access-Token'
:
token
},
verify
=
False
)
else
:
req
=
requests
.
post
(
'/'
.
join
([
master_url_web
,
'Person_requestComputer'
]),
req
=
requests
.
post
(
'/'
.
join
([
master_url_web
,
'Person_requestComputer'
]),
data
=
{
'title'
:
node_name
},
data
=
{
'title'
:
node_name
},
headers
=
{
'X-Access-Token'
:
token
},
headers
=
{
'X-Access-Token'
:
token
},
...
@@ -349,7 +334,7 @@ def gen_auth(conf):
...
@@ -349,7 +334,7 @@ def gen_auth(conf):
def
do_register
(
conf
):
def
do_register
(
conf
):
"""Register new computer on SlapOS Master and generate slapos.cfg"""
"""Register new computer on SlapOS Master and generate slapos.cfg"""
if
conf
.
login
or
conf
.
login_auth
and
conf
.
node_name
:
if
conf
.
login
or
conf
.
login_auth
:
for
login
,
password
in
gen_auth
(
conf
):
for
login
,
password
in
gen_auth
(
conf
):
if
check_credentials
(
conf
.
master_url_web
,
login
,
password
):
if
check_credentials
(
conf
.
master_url_web
,
login
,
password
):
break
break
...
@@ -365,9 +350,7 @@ def do_register(conf):
...
@@ -365,9 +350,7 @@ def do_register(conf):
else
:
else
:
while
not
conf
.
token
:
while
not
conf
.
token
:
conf
.
token
=
input
(
'Computer security token: '
).
strip
()
conf
.
token
=
input
(
'Computer security token: '
).
strip
()
if
not
conf
.
token
.
startswith
(
"V2/"
)
and
not
conf
.
node_name
:
while
not
conf
.
node_name
:
conf
.
node_name
=
input
(
'Computer Name: '
).
strip
()
certificate
,
key
=
get_certificate_key_pair
(
conf
.
logger
,
certificate
,
key
=
get_certificate_key_pair
(
conf
.
logger
,
conf
.
master_url_web
,
conf
.
master_url_web
,
conf
.
node_name
,
conf
.
node_name
,
...
...
slapos/cli/request.py
View file @
3a98bda4
...
@@ -161,31 +161,6 @@ def do_request(logger, conf, local):
...
@@ -161,31 +161,6 @@ def do_request(logger, conf, local):
else
:
else
:
parameters
=
conf
.
parameters
parameters
=
conf
.
parameters
try
:
try
:
if
local
[
'slap'
].
jio_api_connector
:
request_dict
=
{
"title"
:
conf
.
reference
,
"portal_type"
:
"Software Instance"
,
"software_release_uri"
:
conf
.
software_url
,
}
if
conf
.
state
:
request_dict
[
'state'
]
=
conf
.
state
if
conf
.
slave
:
request_dict
[
"shared"
]
=
True
if
conf
.
node
:
request_dict
[
"sla_parameters"
]
=
conf
.
node
if
conf
.
parameters
:
request_dict
[
"parameters"
]
=
json
.
dumps
(
conf
.
parameters
)
if
conf
.
type
:
request_dict
[
"software_type"
]
=
conf
.
type
partition_dict
=
local
[
'slap'
].
jio_api_connector
.
post
(
request_dict
)
if
"$schema"
in
partition_dict
and
"error-response-schema.json"
in
partition_dict
[
"$schema"
]:
logger
.
warning
(
'Server Response: %s'
%
json
.
dumps
(
partition_dict
,
indent
=
2
))
logger
.
warning
(
'Instance requested. Master is provisioning it. Please rerun in a '
'couple of minutes to get connection information.'
)
exit
(
2
)
instance_state
=
partition_dict
[
"state"
]
connection_parameter_dict
=
partition_dict
[
"connection_parameters"
]
else
:
partition
=
local
[
'slap'
].
registerOpenOrder
().
request
(
partition
=
local
[
'slap'
].
registerOpenOrder
().
request
(
software_release
=
conf
.
software_url
,
software_release
=
conf
.
software_url
,
partition_reference
=
conf
.
reference
,
partition_reference
=
conf
.
reference
,
...
@@ -195,10 +170,7 @@ def do_request(logger, conf, local):
...
@@ -195,10 +170,7 @@ def do_request(logger, conf, local):
state
=
conf
.
state
,
state
=
conf
.
state
,
shared
=
conf
.
slave
shared
=
conf
.
slave
)
)
instance_state
=
partition
.
getState
()
logger
.
info
(
'Instance requested.
\
n
State is : %s.'
,
partition
.
getState
())
connection_parameter_dict
=
partition
.
getConnectionParameterDict
()
logger
.
info
(
'Instance requested.
\
n
State is : %s.'
,
instance_state
)
logger
.
info
(
'Connection parameters of instance are:'
)
logger
.
info
(
'Connection parameters of instance are:'
)
connection_parameter_dict
=
partition
.
getConnectionParameterDict
()
connection_parameter_dict
=
partition
.
getConnectionParameterDict
()
if
software_schema
.
getSerialisation
()
==
SoftwareReleaseSerialisation
.
JsonInXml
:
if
software_schema
.
getSerialisation
()
==
SoftwareReleaseSerialisation
.
JsonInXml
:
...
...
slapos/cli/supply.py
View file @
3a98bda4
...
@@ -27,8 +27,6 @@
...
@@ -27,8 +27,6 @@
#
#
##############################################################################
##############################################################################
import
json
from
slapos.cli.config
import
ClientConfigCommand
from
slapos.cli.config
import
ClientConfigCommand
from
slapos.client
import
init
,
ClientConfig
,
_getSoftwareReleaseFromSoftwareString
from
slapos.client
import
init
,
ClientConfig
,
_getSoftwareReleaseFromSoftwareString
...
@@ -65,18 +63,7 @@ def do_supply(logger, software_release, computer_id, local):
...
@@ -65,18 +63,7 @@ def do_supply(logger, software_release, computer_id, local):
software_release
=
_getSoftwareReleaseFromSoftwareString
(
software_release
=
_getSoftwareReleaseFromSoftwareString
(
logger
,
software_release
,
local
[
'product'
])
logger
,
software_release
,
local
[
'product'
])
if
local
[
'slap'
].
jio_api_connector
:
software_installation
=
local
[
'slap'
].
jio_api_connector
.
post
({
"portal_type"
:
"Software Installation"
,
"software_release_uri"
:
software_release
,
"compute_node_id"
:
computer_id
,
"state"
:
'available'
})
if
"$schema"
in
software_installation
and
"error-response-schema.json"
in
software_installation
[
"$schema"
]:
logger
.
warning
(
'Issue during the request. Server Response: %s'
%
json
.
dumps
(
software_installation
,
indent
=
2
))
logger
.
warning
(
'Message: %s'
%
software_installation
.
get
(
"message"
,
""
))
exit
(
2
)
else
:
local
[
'supply'
](
local
[
'supply'
](
software_release
=
software_release
,
software_release
=
software_release
,
computer_guid
=
computer_id
,
computer_guid
=
computer_id
,
...
...
slapos/format.py
View file @
3a98bda4
...
@@ -366,37 +366,6 @@ class Computer(object):
...
@@ -366,37 +366,6 @@ class Computer(object):
connection_dict
[
'cert_file'
]
=
conf
.
cert_file
connection_dict
[
'cert_file'
]
=
conf
.
cert_file
slap_instance
.
initializeConnection
(
conf
.
master_url
,
slap_instance
.
initializeConnection
(
conf
.
master_url
,
**
connection_dict
)
**
connection_dict
)
if
slap_instance
.
jio_api_connector
:
partition_list
=
[]
for
partition
in
self
.
partition_list
:
ip_list
=
[]
network_interface
=
partition
.
tap
.
name
if
partition
.
tap
else
partition
.
reference
for
address
in
partition
.
address_list
:
ip_list
.
append
({
"ip-address"
:
address
[
"addr"
],
"network-interface"
:
network_interface
,
})
if
partition
.
tap
and
partition
.
tap
.
ipv4_addr
:
ip_list
.
append
({
"ip-address"
:
partition
.
tap
.
ipv4_addr
,
"network-interface"
:
partition
.
tap
.
name
,
"gateway-ip-address"
:
partition
.
tap
.
ipv4_gateway
,
"netmask"
:
partition
.
tap
.
netmask
,
"network-address"
:
partition
.
tap
.
ipv4_network
})
partition_list
.
append
({
"partition_id"
:
partition
.
reference
,
"ip_list"
:
ip_list
})
if
conf
.
dry_run
:
return
slap_instance
.
jio_api_connector
.
put
({
"compute_node_id"
:
self
.
reference
,
"compute_partition_list"
:
partition_list
,
"portal_type"
:
"Compute Node"
,
})
else
:
slap_computer
=
slap_instance
.
registerComputer
(
self
.
reference
)
slap_computer
=
slap_instance
.
registerComputer
(
self
.
reference
)
if
conf
.
dry_run
:
if
conf
.
dry_run
:
...
@@ -1697,15 +1666,7 @@ def do_format(conf):
...
@@ -1697,15 +1666,7 @@ def do_format(conf):
conf
.
logger
.
exception
(
'slapos failed to prepare the computer.'
)
conf
.
logger
.
exception
(
'slapos failed to prepare the computer.'
)
return
FormatReturn
.
FAILURE
return
FormatReturn
.
FAILURE
computer
.
update
()
# Dumping and sending to the erp5 the current configuration
if
not
conf
.
dry_run
:
computer
.
dump
(
path_to_xml
=
conf
.
computer_xml
,
path_to_json
=
conf
.
computer_json
,
logger
=
conf
.
logger
)
conf
.
logger
.
info
(
'Posting information to %r'
%
conf
.
master_url
)
computer
.
send
(
conf
)
conf
.
logger
.
info
(
'slapos successfully prepared the computer.'
)
class
FormatConfig
(
object
):
class
FormatConfig
(
object
):
"""This class represents the options for slapos node format
"""This class represents the options for slapos node format
...
...
slapos/grid/SlapObject.py
View file @
3a98bda4
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
import
datetime
import
datetime
import
errno
import
errno
import
json
import
os
import
os
import
pkg_resources
import
pkg_resources
import
pwd
import
pwd
...
@@ -57,7 +56,6 @@ from slapos.grid.svcbackend import getSupervisorRPC
...
@@ -57,7 +56,6 @@ from slapos.grid.svcbackend import getSupervisorRPC
from
slapos.grid.exception
import
(
BuildoutFailedError
,
WrongPermissionError
,
from
slapos.grid.exception
import
(
BuildoutFailedError
,
WrongPermissionError
,
PathDoesNotExistError
,
DiskSpaceError
)
PathDoesNotExistError
,
DiskSpaceError
)
from
slapos.grid.networkcache
import
download_network_cached
,
upload_network_cached
from
slapos.grid.networkcache
import
download_network_cached
,
upload_network_cached
from
slapos.grid.utils
import
md5digest
from
slapos.human
import
bytes2human
from
slapos.human
import
bytes2human
from
slapos.util
import
bytes2str
,
rmtree
from
slapos.util
import
bytes2str
,
rmtree
...
@@ -77,8 +75,6 @@ GROUP_PARTITION_TEMPLATE = bytes2str(
...
@@ -77,8 +75,6 @@ GROUP_PARTITION_TEMPLATE = bytes2str(
pkg_resources
.
resource_string
(
pkg_resources
.
resource_string
(
__name__
,
'templates/group_partition_supervisord.conf.in'
))
__name__
,
'templates/group_partition_supervisord.conf.in'
))
SOFTWARE_INSTANCE_JSON_FILENAME
=
'.software-instance.json'
def
free_space
(
path
,
fn
):
def
free_space
(
path
,
fn
):
while
True
:
while
True
:
...
@@ -519,15 +515,21 @@ class Partition(object):
...
@@ -519,15 +515,21 @@ class Partition(object):
available
=
bytes2human
(
available
),
available
=
bytes2human
(
available
),
required
=
bytes2human
(
required
)))
required
=
bytes2human
(
required
)))
def
_updateCertificate
(
self
,
partition_certificates
):
def
_updateCertificate
(
self
):
if
not
self
.
key_file
or
not
self
.
cert_file
:
if
not
self
.
key_file
or
not
self
.
cert_file
:
# Certificate files are unset, skip.
# Certificate files are unset, skip.
return
return
try
:
partition_certificate
=
self
.
computer_partition
.
getCertificate
()
except
NotFoundError
:
raise
NotFoundError
(
'Partition %s is not known by SlapOS Master.'
%
self
.
partition_id
)
uid
,
gid
=
self
.
getUserGroupId
()
uid
,
gid
=
self
.
getUserGroupId
()
for
name
,
path
in
[(
'certificate'
,
self
.
cert_file
),
(
'key'
,
self
.
key_file
)]:
for
name
,
path
in
[(
'certificate'
,
self
.
cert_file
),
(
'key'
,
self
.
key_file
)]:
new_content
=
partition_certificate
s
[
name
]
new_content
=
partition_certificate
[
name
]
old_content
=
None
old_content
=
None
if
os
.
path
.
exists
(
path
):
if
os
.
path
.
exists
(
path
):
with
open
(
path
)
as
f
:
with
open
(
path
)
as
f
:
...
@@ -583,7 +585,7 @@ class Partition(object):
...
@@ -583,7 +585,7 @@ class Partition(object):
installs the software partition with the help of buildout
installs the software partition with the help of buildout
"""
"""
self
.
logger
.
info
(
"Installing Computer Partition %s..."
self
.
logger
.
info
(
"Installing Computer Partition %s..."
%
self
.
computer_partition
.
get
(
"compute_partition_id"
)
)
%
self
.
partition_id
)
self
.
check_free_space
()
self
.
check_free_space
()
...
@@ -604,20 +606,6 @@ class Partition(object):
...
@@ -604,20 +606,6 @@ class Partition(object):
(
self
.
instance_path
,
permission
,
(
self
.
instance_path
,
permission
,
REQUIRED_COMPUTER_PARTITION_PERMISSION
))
REQUIRED_COMPUTER_PARTITION_PERMISSION
))
uid
,
gid
=
self
.
getUserGroupId
()
# Store software instance json
instance_json_location
=
os
.
path
.
join
(
self
.
instance_path
,
SOFTWARE_INSTANCE_JSON_FILENAME
)
partiton_dict
=
self
.
computer_partition
.
copy
()
partiton_dict
.
pop
(
"slap_partition"
,
None
)
# XXX Check if we want them or not
partiton_dict
.
pop
(
"access_status_message"
,
None
)
with
open
(
instance_json_location
,
'w'
)
as
f
:
json
.
dump
(
partiton_dict
,
f
,
indent
=
2
)
os
.
chown
(
instance_json_location
,
uid
,
gid
)
# Check that Software Release directory is present
# Check that Software Release directory is present
if
not
os
.
path
.
exists
(
self
.
software_path
):
if
not
os
.
path
.
exists
(
self
.
software_path
):
# XXX What should it raise?
# XXX What should it raise?
...
@@ -635,7 +623,6 @@ class Partition(object):
...
@@ -635,7 +623,6 @@ class Partition(object):
# XXX What should it raise?
# XXX What should it raise?
raise
IOError
(
'Software Release %s is not correctly installed.
\
n
Missing file: %s'
%
(
raise
IOError
(
'Software Release %s is not correctly installed.
\
n
Missing file: %s'
%
(
self
.
software_release_url
,
template_location
))
self
.
software_release_url
,
template_location
))
config_location
=
os
.
path
.
join
(
self
.
instance_path
,
'buildout.cfg'
)
config_location
=
os
.
path
.
join
(
self
.
instance_path
,
'buildout.cfg'
)
self
.
logger
.
debug
(
"Copying %r to %r"
%
(
template_location
,
config_location
))
self
.
logger
.
debug
(
"Copying %r to %r"
%
(
template_location
,
config_location
))
shutil
.
copy
(
template_location
,
config_location
)
shutil
.
copy
(
template_location
,
config_location
)
...
@@ -647,27 +634,13 @@ class Partition(object):
...
@@ -647,27 +634,13 @@ class Partition(object):
'templates/buildout-tail.cfg.in'
))
%
{
'templates/buildout-tail.cfg.in'
))
%
{
'computer_id'
:
self
.
computer_id
,
'computer_id'
:
self
.
computer_id
,
'partition_id'
:
self
.
partition_id
,
'partition_id'
:
self
.
partition_id
,
'software_instance_reference'
:
self
.
computer_partition
.
get
(
"reference"
),
'server_url'
:
self
.
server_url
,
'server_url'
:
self
.
server_url
,
'software_release_url'
:
self
.
software_release_url
,
'software_release_url'
:
self
.
software_release_url
,
'key_file'
:
self
.
key_file
,
'key_file'
:
self
.
key_file
,
'cert_file'
:
self
.
cert_file
,
'cert_file'
:
self
.
cert_file
,
'storage_home'
:
self
.
instance_storage_home
,
'storage_home'
:
self
.
instance_storage_home
,
'global_ipv4_network_prefix'
:
self
.
ipv4_global_network
,
'global_ipv4_network_prefix'
:
self
.
ipv4_global_network
,
'shared_part_list'
:
' '
.
join
(
self
.
shared_part_list
.
strip
().
splitlines
(
True
)),
'shared_part_list'
:
' '
.
join
(
self
.
shared_part_list
.
strip
().
splitlines
(
True
))
'parameters_md5sum'
:
md5digest
(
json
.
dumps
(
self
.
computer_partition
.
get
(
"parameters"
,
{}),
sort_keys
=
True
)
),
'connection_parameters_md5sum'
:
md5digest
(
json
.
dumps
(
self
.
computer_partition
.
get
(
"connection_parameters"
,
{}),
sort_keys
=
True
)
),
'instance_state'
:
self
.
computer_partition
.
get
(
"state"
),
'instance_software_type'
:
self
.
computer_partition
.
get
(
"software_type"
),
'instance_processing_timestamp'
:
self
.
computer_partition
.
get
(
"processing_timestamp"
)
}
}
with
open
(
config_location
,
'w'
)
as
f
:
with
open
(
config_location
,
'w'
)
as
f
:
f
.
write
(
buildout_text
)
f
.
write
(
buildout_text
)
...
@@ -683,6 +656,7 @@ class Partition(object):
...
@@ -683,6 +656,7 @@ class Partition(object):
if
q
.
startswith
(
'bootstrap'
)]
if
q
.
startswith
(
'bootstrap'
)]
else
:
else
:
bootstrap_candidate_list
=
[]
bootstrap_candidate_list
=
[]
uid
,
gid
=
self
.
getUserGroupId
()
os
.
chown
(
config_location
,
-
1
,
int
(
gid
))
os
.
chown
(
config_location
,
-
1
,
int
(
gid
))
if
len
(
bootstrap_candidate_list
)
==
0
:
if
len
(
bootstrap_candidate_list
)
==
0
:
buildout_binary
=
os
.
path
.
join
(
self
.
software_path
,
'bin'
,
'buildout'
)
buildout_binary
=
os
.
path
.
join
(
self
.
software_path
,
'bin'
,
'buildout'
)
...
@@ -758,14 +732,6 @@ class Partition(object):
...
@@ -758,14 +732,6 @@ class Partition(object):
self
.
logger
.
warning
(
'No runners nor services found for partition %r'
%
self
.
logger
.
warning
(
'No runners nor services found for partition %r'
%
self
.
partition_id
)
self
.
partition_id
)
else
:
else
:
partition_id
=
self
.
computer_partition
.
get
(
"compute_partition_id"
)
group_partition_template
=
bytes2str
(
pkg_resources
.
resource_string
(
__name__
,
'templates/group_partition_supervisord.conf.in'
))
self
.
supervisor_configuration_group
=
group_partition_template
%
{
'instance_id'
:
partition_id
,
'program_list'
:
','
.
join
([
'_'
.
join
([
partition_id
,
runner
])
for
runner
in
runner_list
+
service_list
])
}
# Same method to add to service and run
# Same method to add to service and run
self
.
addServicesToGroup
(
runner_list
,
self
.
run_path
)
self
.
addServicesToGroup
(
runner_list
,
self
.
run_path
)
self
.
addServicesToGroup
(
self
.
addServicesToGroup
(
...
@@ -838,22 +804,22 @@ class Partition(object):
...
@@ -838,22 +804,22 @@ class Partition(object):
"""Asks supervisord to start the instance. If this instance is not
"""Asks supervisord to start the instance. If this instance is not
installed, we install it.
installed, we install it.
"""
"""
partition_id
=
self
.
computer_partition
.
get
(
"compute_partition_id"
)
self
.
updateSupervisorConfiguration
()
partition_id
=
self
.
partition_id
try
:
try
:
with
self
.
getSupervisorRPC
()
as
supervisor
:
with
self
.
getSupervisorRPC
()
as
supervisor
:
supervisor
.
startProcessGroup
(
partition_id
,
False
)
supervisor
.
startProcessGroup
(
partition_id
,
False
)
except
xmlrpclib
.
Fault
as
exc
:
except
xmlrpclib
.
Fault
as
exc
:
if
exc
.
faultString
.
startswith
(
'BAD_NAME:'
):
if
exc
.
faultString
.
startswith
(
'BAD_NAME:'
):
self
.
logger
.
info
(
"Nothing to start on %s..."
%
self
.
logger
.
info
(
"Nothing to start on %s..."
%
partition_id
)
self
.
computer_partition
.
get
(
"compute_partition_id"
))
else
:
else
:
raise
raise
else
:
else
:
self
.
logger
.
info
(
"Requested start of %s..."
%
self
.
computer_partition
.
get
(
"compute_partition_id"
)
)
self
.
logger
.
info
(
"Requested start of %s..."
%
partition_id
)
def
stop
(
self
):
def
stop
(
self
):
"""Asks supervisord to stop the instance."""
"""Asks supervisord to stop the instance."""
partition_id
=
self
.
computer_partition
.
get
(
"compute_partition_id"
)
partition_id
=
self
.
partition_id
filename
=
partition_id
+
'.conf'
filename
=
partition_id
+
'.conf'
filepath
=
os
.
path
.
join
(
filepath
=
os
.
path
.
join
(
self
.
supervisord_partition_configuration_dir
,
filename
)
self
.
supervisord_partition_configuration_dir
,
filename
)
...
@@ -864,13 +830,13 @@ class Partition(object):
...
@@ -864,13 +830,13 @@ class Partition(object):
raise
raise
else
:
else
:
self
.
updateSupervisor
()
self
.
updateSupervisor
()
self
.
logger
.
info
(
"Requested stop of %s..."
%
self
.
computer_partition
.
get
(
"compute_partition_id"
)
)
self
.
logger
.
info
(
"Requested stop of %s..."
%
partition_id
)
def
destroy
(
self
):
def
destroy
(
self
):
"""Destroys the partition and makes it available for subsequent use."
"""Destroys the partition and makes it available for subsequent use."
"""
"""
self
.
logger
.
info
(
"Destroying Computer Partition %s..."
self
.
logger
.
info
(
"Destroying Computer Partition %s..."
%
self
.
computer_partition
.
get
(
"compute_partition_id"
)
)
%
self
.
partition_id
)
self
.
createRetentionLockDate
()
self
.
createRetentionLockDate
()
if
not
self
.
checkRetentionIsAuthorized
():
if
not
self
.
checkRetentionIsAuthorized
():
...
...
slapos/grid/slapgrid.py
View file @
3a98bda4
This diff is collapsed.
Click to expand it.
slapos/grid/templates/buildout-tail.cfg.in
View file @
3a98bda4
...
@@ -15,7 +15,6 @@ key-file = %(key_file)s
...
@@ -15,7 +15,6 @@ key-file = %(key_file)s
cert-file = %(cert_file)s
cert-file = %(cert_file)s
shared-part-list =
shared-part-list =
%(shared_part_list)s
%(shared_part_list)s
software-instance-reference = %(software_instance_reference)s
[slap_connection]
[slap_connection]
# Kept for backward compatiblity
# Kept for backward compatiblity
...
@@ -32,11 +31,3 @@ storage-home = %(storage_home)s
...
@@ -32,11 +31,3 @@ storage-home = %(storage_home)s
[network-information]
[network-information]
global-ipv4-network = %(global_ipv4_network_prefix)s
global-ipv4-network = %(global_ipv4_network_prefix)s
# This is end of zc.buildout profile's tail added by slapgrid
# This is end of zc.buildout profile's tail added by slapgrid
[software-instance-data]
state = %(instance_state)s
software-type = %(instance_software_type)s
reference = %(software_instance_reference)s
processing-timestamp = %(instance_processing_timestamp)s
connection-parameters-md5sum = %(connection_parameters_md5sum)s
parameters-md5sum = %(parameters_md5sum)s
slapos/grid/watchdog.py
View file @
3a98bda4
...
@@ -187,26 +187,6 @@ class Watchdog(object):
...
@@ -187,26 +187,6 @@ class Watchdog(object):
def
handle_process_state_change_event
(
self
,
headers
,
payload_dict
):
def
handle_process_state_change_event
(
self
,
headers
,
payload_dict
):
partition_id
=
payload_dict
[
'groupname'
]
partition_id
=
payload_dict
[
'groupname'
]
self
.
initialize_connection
(
partition_id
)
self
.
initialize_connection
(
partition_id
)
if
self
.
slap
.
jio_api_connector
:
instance_list
=
self
.
slap
.
jio_api_connector
.
allDocs
({
"portal_type"
:
"Software Instance"
,
"compute_node_id"
:
self
.
computer_id
,
"compute_partition_id"
:
partition_id
,
}).
get
(
"result_list"
,
[])
if
len
(
instance_list
)
!=
1
:
raise
ValueError
(
"No instance found for %s %s %s"
%
(
self
.
computer_id
,
partition_id
,
instance_list
,
))
self
.
slap
.
jio_api_connector
.
put
({
"portal_type"
:
"Software Instance"
,
"reported_state"
:
"bang"
,
"status_message"
:
"%s process in partition %s encountered a problem"
%
(
payload_dict
[
'processname'
],
partition_id
),
"reference"
:
instance_list
[
0
][
"reference"
]
})
else
:
partition
=
slapos
.
slap
.
ComputerPartition
(
partition
=
slapos
.
slap
.
ComputerPartition
(
computer_id
=
self
.
computer_id
,
computer_id
=
self
.
computer_id
,
connection_helper
=
self
.
slap
.
_connection_helper
,
connection_helper
=
self
.
slap
.
_connection_helper
,
...
...
slapos/manager/portredir.py
View file @
3a98bda4
...
@@ -82,8 +82,9 @@ class Manager(object):
...
@@ -82,8 +82,9 @@ class Manager(object):
# Get partitions IPv6 address
# Get partitions IPv6 address
computer_partition
=
partition
.
computer_partition
computer_partition
=
partition
.
computer_partition
parameter_dict
=
computer_partition
.
getInstanceParameterDict
()
partition_ip_list
=
computer_partition
[
'ip_list'
]
+
computer_partition
.
get
(
partition_ip_list
=
parameter_dict
[
'ip_list'
]
+
parameter_dict
.
get
(
'full_ip_list'
,
[])
'full_ip_list'
,
[])
partition_ip_list
=
[
tup
[
1
]
for
tup
in
partition_ip_list
]
partition_ip_list
=
[
tup
[
1
]
for
tup
in
partition_ip_list
]
...
...
slapos/slap/hateoas.py
View file @
3a98bda4
...
@@ -60,42 +60,6 @@ ALLOWED_JIO_FIELD_LIST = [
...
@@ -60,42 +60,6 @@ ALLOWED_JIO_FIELD_LIST = [
"FloatField"
,
"FloatField"
,
"TextAreaField"
]
"TextAreaField"
]
# https://stackoverflow.com/a/33571117
def
_byteify
(
data
,
ignore_dicts
=
False
):
if
isinstance
(
data
,
str
):
return
data
# if this is a list of values, return list of byteified values
if
isinstance
(
data
,
list
):
return
[
_byteify
(
item
,
ignore_dicts
=
True
)
for
item
in
data
]
# if this is a dictionary, return dictionary of byteified keys and values
# but only if we haven't already byteified it
if
isinstance
(
data
,
dict
)
and
not
ignore_dicts
:
return
{
_byteify
(
key
,
ignore_dicts
=
True
):
_byteify
(
value
,
ignore_dicts
=
True
)
for
key
,
value
in
data
.
items
()
# changed to .items() for python 2.7/3
}
# python 3 compatible duck-typing
# if this is a unicode string, return its string representation
if
str
(
type
(
data
))
==
"<type 'unicode'>"
:
return
data
.
encode
(
'utf-8'
)
# if it's anything else, return it in its original form
return
data
def
json_loads_byteified
(
json_text
):
"""
Encode string when loading JSON
"""
return
_byteify
(
json
.
loads
(
json_text
,
object_hook
=
_byteify
),
ignore_dicts
=
True
)
class
TempDocument
(
object
):
class
TempDocument
(
object
):
def
__init__
(
self
,
**
kw
):
def
__init__
(
self
,
**
kw
):
"""
"""
...
@@ -122,8 +86,7 @@ class ConnectionHelper:
...
@@ -122,8 +86,7 @@ class ConnectionHelper:
self
.
session
=
CacheControl
(
self
.
uncached_session
,
self
.
session
=
CacheControl
(
self
.
uncached_session
,
cache
=
FileCache
(
os
.
path
.
expanduser
(
"~/.slapos_cached_get"
)))
cache
=
FileCache
(
os
.
path
.
expanduser
(
"~/.slapos_cached_get"
)))
def
do_request
(
self
,
method
,
path
,
params
=
None
,
data
=
None
,
headers
=
None
,
def
do_request
(
self
,
method
,
path
,
params
=
None
,
data
=
None
,
headers
=
None
):
expect_json_error
=
False
,
cert_key
=
None
):
url
=
parse
.
urljoin
(
self
.
slapgrid_uri
,
path
)
url
=
parse
.
urljoin
(
self
.
slapgrid_uri
,
path
)
if
headers
is
None
:
if
headers
is
None
:
headers
=
{}
headers
=
{}
...
@@ -133,22 +96,24 @@ class ConnectionHelper:
...
@@ -133,22 +96,24 @@ class ConnectionHelper:
# raise ValueError('method path should be relative: %s' % path)
# raise ValueError('method path should be relative: %s' % path)
try
:
try
:
if
url
.
startswith
(
'https'
)
and
cert_key
is
None
:
if
url
.
startswith
(
'https'
):
cert_key
=
(
self
.
cert_file
,
self
.
key_file
)
cert
=
(
self
.
cert_file
,
self
.
key_file
)
else
:
cert
=
None
# XXX TODO: handle host cert verify
# XXX TODO: handle host cert verify
# Old behavior was to pass empty parameters as "None" value.
# Old behavior was to pass empty parameters as "None" value.
# Behavior kept for compatibility with old slapproxies (< v1.3.3).
# Behavior kept for compatibility with old slapproxies (< v1.3.3).
# Can be removed when old slapproxies are no longer in use.
# Can be removed when old slapproxies are no longer in use.
if
data
and
isinstance
(
data
,
dict
)
:
if
data
:
for
k
,
v
in
six
.
iteritems
(
data
):
for
k
,
v
in
six
.
iteritems
(
data
):
if
v
is
None
:
if
v
is
None
:
data
[
k
]
=
'None'
data
[
k
]
=
'None'
req
=
method
(
url
=
url
,
req
=
method
(
url
=
url
,
params
=
params
,
params
=
params
,
cert
=
cert
_key
,
cert
=
cert
,
verify
=
False
,
verify
=
False
,
data
=
data
,
data
=
data
,
headers
=
headers
,
headers
=
headers
,
...
@@ -166,8 +131,6 @@ class ConnectionHelper:
...
@@ -166,8 +131,6 @@ class ConnectionHelper:
"enabled on your machine and that the server is available. The "
"enabled on your machine and that the server is available. The "
"original error was:
\
n
%s"
%
exc
)
"original error was:
\
n
%s"
%
exc
)
except
requests
.
HTTPError
as
exc
:
except
requests
.
HTTPError
as
exc
:
if
expect_json_error
and
not
int
(
exc
.
response
.
status_code
)
>=
500
:
return
req
if
exc
.
response
.
status_code
==
requests
.
status_codes
.
codes
.
not_found
:
if
exc
.
response
.
status_code
==
requests
.
status_codes
.
codes
.
not_found
:
msg
=
url
msg
=
url
if
params
:
if
params
:
...
@@ -193,15 +156,21 @@ class ConnectionHelper:
...
@@ -193,15 +156,21 @@ class ConnectionHelper:
return
req
return
req
def
callJsonRpcAPI
(
self
,
path
,
data
,
cert_key
=
None
):
def
GET
(
self
,
path
,
params
=
None
,
headers
=
None
):
req
=
self
.
do_request
(
requests
.
pos
t
,
req
=
self
.
do_request
(
self
.
session
.
ge
t
,
path
=
path
,
path
=
path
,
data
=
json
.
dumps
(
data
),
params
=
params
,
headers
=
{
'Content-type'
:
'application/json'
},
headers
=
headers
)
expect_json_error
=
True
,
return
req
.
text
.
encode
(
'utf-8'
)
cert_key
=
cert_key
)
return
json_loads_byteified
(
req
.
text
)
def
POST
(
self
,
path
,
params
=
None
,
data
=
None
,
content_type
=
'application/x-www-form-urlencoded'
):
req
=
self
.
do_request
(
requests
.
post
,
path
=
path
,
params
=
params
,
data
=
data
,
headers
=
{
'Content-type'
:
content_type
})
return
req
.
text
.
encode
(
'utf-8'
)
class
HateoasNavigator
(
object
):
class
HateoasNavigator
(
object
):
"""
"""
...
...
slapos/slap/slap.py
View file @
3a98bda4
...
@@ -52,7 +52,7 @@ except ImportError: # XXX to be removed once we depend on typing
...
@@ -52,7 +52,7 @@ except ImportError: # XXX to be removed once we depend on typing
from
.exception
import
ResourceNotReady
,
ServerError
,
NotFoundError
,
\
from
.exception
import
ResourceNotReady
,
ServerError
,
NotFoundError
,
\
ConnectionError
ConnectionError
from
.hateoas
import
SlapHateoasNavigator
,
ConnectionHelper
,
json_loads_byteified
from
.hateoas
import
SlapHateoasNavigator
,
ConnectionHelper
from
slapos.util
import
(
SoftwareReleaseSchema
,
SoftwareReleaseSchemaValidationError
,
from
slapos.util
import
(
SoftwareReleaseSchema
,
SoftwareReleaseSchemaValidationError
,
bytes2str
,
calculate_dict_hash
,
dict2xml
,
dumps
,
loads
,
bytes2str
,
calculate_dict_hash
,
dict2xml
,
dumps
,
loads
,
unicode2str
,
xml2dict
)
unicode2str
,
xml2dict
)
...
@@ -762,9 +762,7 @@ class SlapConnectionHelper(ConnectionHelper):
...
@@ -762,9 +762,7 @@ class SlapConnectionHelper(ConnectionHelper):
return
loads
(
xml
)
return
loads
(
xml
)
getHateoasUrl_cache
=
{}
getHateoasUrl_cache
=
{}
getjIOAPI_cache
=
{}
@
implementer
(
interface
.
slap
)
@
implementer
(
interface
.
slap
)
class
slap
:
class
slap
:
...
@@ -775,6 +773,7 @@ class slap:
...
@@ -775,6 +773,7 @@ class slap:
slapgrid_rest_uri
=
None
):
slapgrid_rest_uri
=
None
):
if
master_ca_file
:
if
master_ca_file
:
raise
NotImplementedError
(
'Master certificate not verified in this version: %s'
%
master_ca_file
)
raise
NotImplementedError
(
'Master certificate not verified in this version: %s'
%
master_ca_file
)
self
.
_connection_helper
=
SlapConnectionHelper
(
self
.
_connection_helper
=
SlapConnectionHelper
(
slapgrid_uri
,
key_file
,
cert_file
,
master_ca_file
,
timeout
)
slapgrid_uri
,
key_file
,
cert_file
,
master_ca_file
,
timeout
)
...
...
slapos/tests/test_cli.py
View file @
3a98bda4
...
@@ -89,7 +89,6 @@ class CliMixin(unittest.TestCase):
...
@@ -89,7 +89,6 @@ class CliMixin(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
slap
=
slapos
.
slap
.
slap
()
slap
=
slapos
.
slap
.
slap
()
self
.
logger
=
create_autospec
(
logging
.
Logger
)
self
.
logger
=
create_autospec
(
logging
.
Logger
)
slap
.
initializeConnection
(
"http://127.0.0.1:80/"
)
self
.
local
=
{
'slap'
:
slap
,
'product'
:
SoftwareProductCollection
(
self
.
logger
,
slap
)}
self
.
local
=
{
'slap'
:
slap
,
'product'
:
SoftwareProductCollection
(
self
.
logger
,
slap
)}
self
.
conf
=
create_autospec
(
ClientConfig
)
self
.
conf
=
create_autospec
(
ClientConfig
)
self
.
sign_cert_list
=
signature_certificate_list
self
.
sign_cert_list
=
signature_certificate_list
...
...
slapos/tests/test_object.py
View file @
3a98bda4
...
@@ -149,6 +149,7 @@ class MasterMixin(BasicMixin, unittest.TestCase):
...
@@ -149,6 +149,7 @@ class MasterMixin(BasicMixin, unittest.TestCase):
self
,
self
,
software_release_url
,
software_release_url
,
partition_id
=
None
,
partition_id
=
None
,
slap_computer_partition
=
None
,
retention_delay
=
None
,
retention_delay
=
None
,
partition_timeout
=
None
,
partition_timeout
=
None
,
shared_part_list
=
''
,
shared_part_list
=
''
,
...
@@ -166,18 +167,10 @@ class MasterMixin(BasicMixin, unittest.TestCase):
...
@@ -166,18 +167,10 @@ class MasterMixin(BasicMixin, unittest.TestCase):
if
partition_id
is
None
:
if
partition_id
is
None
:
partition_id
=
'mypartition'
partition_id
=
'mypartition'
software_instance
=
{
if
slap_computer_partition
is
None
:
"reference"
:
partition_id
,
slap_computer_partition
=
SlapComputerPartition
(
"compute_node_id"
:
'bidon'
,
computer_id
=
'bidon'
,
"portal_type"
:
"Software Instance"
,
partition_id
=
partition_id
)
"compute_partition_id"
:
partition_id
,
"state"
:
"stopped"
,
"software_type"
:
None
,
"parameters"
:
{},
"processing_timestamp"
:
0
,
"ip_list"
:
[],
"full_ip_list"
:
[],
}
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
partition_id
)
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
partition_id
)
os
.
mkdir
(
instance_path
)
os
.
mkdir
(
instance_path
)
...
@@ -193,7 +186,7 @@ class MasterMixin(BasicMixin, unittest.TestCase):
...
@@ -193,7 +186,7 @@ class MasterMixin(BasicMixin, unittest.TestCase):
supervisord_partition_configuration_dir
=
supervisor_configuration_path
,
supervisord_partition_configuration_dir
=
supervisor_configuration_path
,
supervisord_socket
=
svcbackend
.
_getSupervisordSocketPath
(
supervisord_socket
=
svcbackend
.
_getSupervisordSocketPath
(
self
.
instance_root
,
logging
.
getLogger
(
self
.
id
())),
self
.
instance_root
,
logging
.
getLogger
(
self
.
id
())),
computer_partition
=
s
oftware_instance
,
computer_partition
=
s
lap_computer_partition
,
computer_id
=
'bidon'
,
computer_id
=
'bidon'
,
partition_id
=
partition_id
,
partition_id
=
partition_id
,
server_url
=
'bidon'
,
server_url
=
'bidon'
,
...
...
slapos/tests/test_slapformat.py
View file @
3a98bda4
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
from
__future__
import
print_function
from
__future__
import
print_function
import
glob
import
glob
import
json
import
logging
import
logging
import
os
import
os
import
shutil
import
shutil
...
@@ -52,8 +51,6 @@ import os
...
@@ -52,8 +51,6 @@ import os
import
pwd
import
pwd
import
time
import
time
import
mock
import
mock
import
httmock
from
six.moves.urllib
import
parse
from
.test_slapgrid
import
DummyManager
from
.test_slapgrid
import
DummyManager
...
@@ -687,81 +684,6 @@ class TestFormatDump(SlapformatMixin):
...
@@ -687,81 +684,6 @@ class TestFormatDump(SlapformatMixin):
shutil
.
rmtree
(
self
.
_tempdir
,
True
)
shutil
.
rmtree
(
self
.
_tempdir
,
True
)
super
(
TestFormatDump
,
self
).
tearDown
()
super
(
TestFormatDump
,
self
).
tearDown
()
class
TestConfForAPI
():
def
__init__
(
self
):
self
.
master_url
=
"https://127.0.0.1"
self
.
key_file
=
None
self
.
cert_file
=
None
self
.
dry_run
=
False
class
TestFormatSendToMaster
(
SlapformatMixin
):
def
setUp
(
self
):
super
(
TestFormatSendToMaster
,
self
).
setUp
()
self
.
restoreOs
()
self
.
_tempdir
=
tempfile
.
mkdtemp
()
self
.
sequence
=
[]
self
.
body_sequence
=
[]
def
jio_api_request_handler
(
self
,
url
,
req
):
self
.
sequence
.
append
(
url
.
path
)
if
req
.
method
==
'GET'
:
qs
=
parse
.
parse_qs
(
url
.
query
)
else
:
qs
=
parse
.
parse_qs
(
req
.
body
)
if
url
.
path
.
startswith
(
'/api/'
):
content
=
json
.
loads
(
req
.
body
)
self
.
body_sequence
.
append
(
content
)
return
json
.
dumps
({})
def
test
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
instance_root
=
os
.
path
.
join
(
self
.
_tempdir
,
'instance_root'
),
software_root
=
os
.
path
.
join
(
self
.
_tempdir
,
'software_root'
),
tap_ipv6
=
True
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'myinterface'
,
ipv4_local_network
=
'127.0.0.1/16'
),
partition_list
=
[
slapos
.
format
.
Partition
(
'partition'
,
'part_path'
,
slapos
.
format
.
User
(
'testuser'
),
[],
tap
=
slapos
.
format
.
Tap
(
'tap'
)),
])
global
USER_LIST
USER_LIST
=
[
'testuser'
]
global
INTERFACE_DICT
INTERFACE_DICT
[
'myinterface'
]
=
{
socket
.
AF_INET
:
[{
'addr'
:
'192.168.242.77'
,
'broadcast'
:
'127.0.0.1'
,
'netmask'
:
'255.255.255.0'
}],
socket
.
AF_INET6
:
[{
'addr'
:
'2a01:e35:2e27::e59c'
,
'netmask'
:
'ffff:ffff:ffff:ffff::'
}]
}
computer
.
format
(
alter_user
=
False
,
alter_network
=
False
,
create_tap
=
False
)
test_configuration
=
TestConfForAPI
()
with
httmock
.
HTTMock
(
self
.
jio_api_request_handler
):
computer
.
send
(
test_configuration
)
self
.
assertEqual
(
self
.
sequence
,
[
'/getHateoasUrl'
,
'/api/put/'
])
self
.
assertEqual
(
self
.
body_sequence
,
[
{
'portal_type'
:
'Compute Node'
,
'compute_node_id'
:
'computer'
,
'compute_partition_list'
:
[
{
'ip_list'
:
[
{
'ip-address'
:
computer
.
partition_list
[
0
].
address_list
[
0
][
"addr"
],
'network-interface'
:
'tap'
},
{
'ip-address'
:
computer
.
partition_list
[
0
].
address_list
[
1
][
"addr"
],
'network-interface'
:
'tap'
}
],
'partition_id'
:
'partition'
}
]
}
]
)
def
tearDown
(
self
):
shutil
.
rmtree
(
self
.
_tempdir
,
True
)
super
(
TestFormatSendToMaster
,
self
).
tearDown
()
class
SlapGridPartitionMock
:
class
SlapGridPartitionMock
:
...
...
slapos/tests/test_slapgrid.py
View file @
3a98bda4
This diff is collapsed.
Click to expand it.
slapos/tests/test_slapgrid_slaptool.py
deleted
100644 → 0
View file @
447d3da4
This diff is collapsed.
Click to expand it.
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