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
Boxiang Sun
slapos.core
Commits
70dfeda7
Commit
70dfeda7
authored
Apr 05, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into payzen-fixup
parents
2173d319
35752d44
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
142 additions
and
56 deletions
+142
-56
CHANGES.txt
CHANGES.txt
+2
-4
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_computer_partition.xml
...catalog/erp5_mysql_innodb/z_create_computer_partition.xml
+1
-1
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_software_instance_tree.xml
...log/erp5_mysql_innodb/z_create_software_instance_tree.xml
+1
-1
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_software_release.xml
...l_catalog/erp5_mysql_innodb/z_create_software_release.xml
+1
-1
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_versioning.xml
.../portal_catalog/erp5_mysql_innodb/z_create_versioning.xml
+1
-1
master/bt5/vifib_mysql_innodb_catalog/bt/revision
master/bt5/vifib_mysql_innodb_catalog/bt/revision
+1
-1
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance.xml
...rface_workflow/scripts/Person_requestSoftwareInstance.xml
+9
-7
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
master/product/Vifib/tests/testVifibSlapBug.py
master/product/Vifib/tests/testVifibSlapBug.py
+67
-0
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
+0
-12
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+19
-3
slapos.cfg.example
slapos.cfg.example
+11
-10
slapos/format.py
slapos/format.py
+17
-13
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+11
-0
slapos/grid/utils.py
slapos/grid/utils.py
+0
-1
No files found.
CHANGES.txt
View file @
70dfeda7
...
...
@@ -4,10 +4,8 @@ Changes
0.25 (Unreleased)
-----------------
* Bugfix: Remove CONFIG_SITE from environment variables. On some platforms, it
can change any software's libdir name (to things like lib64) and thus
break all other software trying to fetch libraries.
[Cedric de Saint Martin]
* Fix support for no_bridge option in configuration files for some values:
no_bridge = false was stated as true. [Cedric de Saint Martin]
0.24 (2012-03-29)
-----------------
...
...
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_computer_partition.xml
View file @
70dfeda7
...
...
@@ -68,7 +68,7 @@ CREATE TABLE `computer_partition` (\n
`free_for_request` INT(1),\n
`software_type` VARCHAR(255),\n
PRIMARY KEY (`uid`, `software_release_url`)\n
)
TYP
E=InnoDB;\n
)
ENGIN
E=InnoDB;\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_software_instance_tree.xml
View file @
70dfeda7
...
...
@@ -66,7 +66,7 @@ CREATE TABLE `software_instance_tree` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`root_uid` BIGINT UNSIGNED NOT NULL,\n
PRIMARY KEY (`uid`, `root_uid`)\n
)
TYP
E=InnoDB;\n
)
ENGIN
E=InnoDB;\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_software_release.xml
View file @
70dfeda7
...
...
@@ -65,7 +65,7 @@
`url` varchar(255),\n
`state` varchar(255),\n
PRIMARY KEY (`uid`, `delivery_line_uid`)\n
)
TYP
E=InnoDB;\n
)
ENGIN
E=InnoDB;\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_versioning.xml
View file @
70dfeda7
...
...
@@ -43,7 +43,7 @@
KEY `effective_date` (`effective_date`),\n
KEY `expiration_date` (`effective_date`),\n
KEY `frequency_index` (`creation_date_index`, `frequency_index`)\n
)
TYP
E=InnoDB;\n
)
ENGIN
E=InnoDB;\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_mysql_innodb_catalog/bt/revision
View file @
70dfeda7
36
\ No newline at end of file
37
\ No newline at end of file
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance.xml
View file @
70dfeda7
...
...
@@ -74,6 +74,11 @@ else:\n
tag = "%s_%s_inProgress" % (person.getUid(), \n
software_title)\n
\n
if (portal.portal_activities.countMessageWithTag(tag) >
0):\n
# The software instance is already under creation but can not be fetched from catalog\n
# As it is not possible to fetch informations, it is better to raise an error\n
raise NotImplementedError(tag)\n
\n
# Check if it already exists\n
cleanup_resource = portal.portal_preferences.getPreferredInstanceCleanupResource()\n
request_hosting_subscription = None\n
...
...
@@ -86,6 +91,8 @@ for hs in portal.portal_catalog(\n
try:\n
cleanup_delivery_line = si.Item_getInstancePackingListLine(cleanup_resource)\n
except ValueError:\n
order_line = si.getAggregateRelatedValue(portal_type=\'Sale Order Line\')\n
if order_line.getSimulationState() != \'cancelled\':\n
request_hosting_subscription = hs\n
break\n
else:\n
...
...
@@ -93,11 +100,6 @@ for hs in portal.portal_catalog(\n
request_hosting_subscription = hs\n
break\n
\n
if (portal.portal_activities.countMessageWithTag(tag) >
0):\n
# The software instance is already under creation but can not be fetched from catalog\n
# As it is not possible to fetch informations, it is better to raise an error\n
raise NotImplementedError(tag)\n
\n
if (request_hosting_subscription is None):\n
hosting_subscription_reference = "HOSTSUBS-%s" % context.getPortalObject().portal_ids\\\n
.generateNewId(id_group=\'slap_hosting_subscription_reference\', id_generator=\'uid\')\n
...
...
master/bt5/vifib_slap/bt/revision
View file @
70dfeda7
689
\ No newline at end of file
691
\ No newline at end of file
master/product/Vifib/tests/testVifibSlapBug.py
View file @
70dfeda7
...
...
@@ -1212,6 +1212,73 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_request_new_with_destroyed_while_looking_for_partition_reference
(
self
):
"""Prove that having destroyed SI allows to request new one with same
reference, when destruction was done while looking for new partition"""
self
.
computer_partition_amount
=
0
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_published_software_release
+
\
self
.
prepare_formated_computer
+
"""
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
SetRandomRequestedReference
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstancePrepare
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckSoftwareInstanceNoDeliveryRelated
Logout
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
Logout
LoginDefaultUser
CheckSoftwareInstanceCancelledSaleOrderLine
Tic # in order to give chance to update Open Order
CheckOpenOrderLineRemoved
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckSoftwareInstanceOrderedSaleOrderLine
CheckSoftwareInstanceNoDeliveryRelated
Logout
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_request_new_with_destroyed_reference
(
self
):
"""Prove that having destroyed SI allows to request new one with same
reference"""
...
...
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
View file @
70dfeda7
...
...
@@ -128,18 +128,6 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
stepCheckSoftwareInstanceNoDeliveryRelated
(
self
,
sequence
,
**
kw
):
self
.
assertEqual
(
None
,
self
.
portal
.
portal_catalog
.
getResultValue
(
default_aggregate_uid
=
sequence
[
'software_instance_uid'
],
portal_type
=
self
.
sale_packing_list_line_portal_type
))
def
stepCheckSoftwareInstanceCancelledSaleOrderLine
(
self
,
sequence
,
**
kw
):
self
.
assertEqual
(
'cancelled'
,
self
.
portal
.
portal_catalog
.
getResultValue
(
default_aggregate_uid
=
sequence
[
'software_instance_uid'
],
portal_type
=
self
.
sale_order_line_portal_type
).
getSimulationState
())
def
test_person_destroy_not_instanciable_software_instance
(
self
):
"""Check that if there is no way to instantiate software instance
on any partition person is able to destroy it"""
...
...
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
70dfeda7
...
...
@@ -177,6 +177,24 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
########################################
# Steps -- scenarios
########################################
def
stepCheckSoftwareInstanceNoDeliveryRelated
(
self
,
sequence
,
**
kw
):
self
.
assertEqual
(
None
,
self
.
portal
.
portal_catalog
.
getResultValue
(
default_aggregate_uid
=
sequence
[
'software_instance_uid'
],
portal_type
=
self
.
sale_packing_list_line_portal_type
))
def
stepCheckSoftwareInstanceCancelledSaleOrderLine
(
self
,
sequence
,
**
kw
):
self
.
assertEqual
(
'cancelled'
,
self
.
portal
.
portal_catalog
.
getResultValue
(
default_aggregate_uid
=
sequence
[
'software_instance_uid'
],
portal_type
=
self
.
sale_order_line_portal_type
).
getSimulationState
())
def
stepCheckSoftwareInstanceOrderedSaleOrderLine
(
self
,
sequence
,
**
kw
):
self
.
assertEqual
(
'ordered'
,
self
.
portal
.
portal_catalog
.
getResultValue
(
default_aggregate_uid
=
sequence
[
'software_instance_uid'
],
portal_type
=
self
.
sale_order_line_portal_type
).
getSimulationState
())
def
stepCheckOpenOrderLineRemoved
(
self
,
sequence
,
**
kw
):
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'software_instance_uid'
])
...
...
@@ -354,9 +372,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
portal_type
=
self
.
software_instance_portal_type
,
title
=
sequence
[
'requested_reference'
]):
# only not yet destroyed ones
try
:
software_instance
.
Item_getInstancePackingListLine
(
cleanup_resource
)
except
ValueError
:
if
software_instance
.
SoftwareInstance_getStatus
()
!=
'Destroyed'
:
software_instance_list
.
append
(
software_instance
)
self
.
assertEqual
(
1
,
len
(
software_instance_list
))
...
...
slapos.cfg.example
View file @
70dfeda7
...
...
@@ -2,21 +2,22 @@
software_root = /opt/slapgrid
instance_root = /srv/slapgrid
master_url = https://slap.vifib.com/
computer_id = your computer id
buildout = /path/to/buildout/binary
# Replace computer_id by the unique identifier of your computer on vifib.net,
# starting by COMP-
computer_id = COMP-12345
key_file = /etc/opt/slapos/key
cert_file = /etc/opt/slapos/certificate
certificate_repository_path = /etc/opt/slapos/pki/
[slapformat]
# Replace by your network interface like eth0, eth1, slapbr0...
interface_name = interfacename
computer_xml = /opt/slapos/slapos.xml
log_file = /opt/slapos/slapformat.log
partition_amount = 200
interface_name = br0
partition_amount = 20
partition_base_name = slappart
user_base_name = slapuser
tap_base_name = slaptap
# You can choose any other local network which does not conflict with your
# current machine configuration
ipv4_local_network = 10.0.0.0/16
[slapproxy]
host = 127.0.0.1
port = 5000
# You could also specify: /path/to/file
database_uri = :memory:
slapos/format.py
View file @
70dfeda7
...
...
@@ -1080,12 +1080,13 @@ class Config(object):
self
.
logger
.
addHandler
(
logging
.
StreamHandler
())
# Convert strings to booleans
root_needed
=
False
for
o
in
[
'alter_network'
,
'alter_user'
]:
if
getattr
(
self
,
o
).
lower
()
==
'true'
:
for
o
in
[
'alter_network'
,
'alter_user'
,
'no_bridge'
]:
attr
=
getattr
(
self
,
o
)
if
isinstance
(
attr
,
str
):
if
attr
.
lower
()
==
'true'
:
root_needed
=
True
setattr
(
self
,
o
,
True
)
elif
getattr
(
self
,
o
)
.
lower
()
==
'false'
:
elif
attr
.
lower
()
==
'false'
:
setattr
(
self
,
o
,
False
)
else
:
message
=
'Option %r needs to be "True" or "False", wrong value: '
\
...
...
@@ -1102,7 +1103,10 @@ class Config(object):
if
self
.
alter_network
:
self
.
checkRequiredBinary
([
'brctl'
])
if
self
.
dry_run
:
# Check if root is needed
if
(
self
.
alter_network
or
self
.
alter_user
)
and
not
self
.
dry_run
:
root_needed
=
True
else
:
root_needed
=
False
# check root
...
...
slapos/grid/slapgrid.py
View file @
70dfeda7
...
...
@@ -57,6 +57,8 @@ import tempfile
from
time
import
strftime
import
StringIO
from
lxml
import
etree
from
time
import
sleep
from
random
import
random
MANDATORY_PARAMETER_LIST
=
[
...
...
@@ -114,6 +116,8 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
help
=
"Promise timeout in seconds."
)
parser
.
add_argument
(
"configuration_file"
,
nargs
=
1
,
type
=
argparse
.
FileType
(),
help
=
"SlapOS configuration file."
)
parser
.
add_argument
(
"--maximal_delay"
,
help
=
"The maximal delay value in seconds. "
\
"A negative value leads start immediately."
)
# Parses arguments
if
argument_tuple
==
():
...
...
@@ -215,6 +219,13 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
else
:
signature_certificate_list
=
None
maximal_delay
=
float
(
option_dict
.
get
(
"maximal_delay"
,
"300"
))
if
maximal_delay
>
0
:
duration
=
maximal_delay
*
random
()
logging
.
info
(
"Sleeping for %s seconds. To disable this feature, "
\
"check maximal_delay parameter in manual."
%
duration
)
time
.
sleep
(
duration
)
# Returning new Slapgrid instance and options
return
([
Slapgrid
(
software_root
=
option_dict
[
'software_root'
],
instance_root
=
option_dict
[
'instance_root'
],
...
...
slapos/grid/utils.py
View file @
70dfeda7
...
...
@@ -62,7 +62,6 @@ SYSTEM_ENVIRONMENT_REMOVE_LIST = [
'TMP'
,
'TMPDIR'
,
'USER'
,
'CONFIG_SITE'
,
]
LOCALE_ENVIRONMENT_REMOVE_LIST
=
[
...
...
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