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
Ivan Tyagov
slapos.core
Commits
034f3166
Commit
034f3166
authored
Apr 22, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos format: drop limit of 4 data storage directory
parent
29ea31cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
slapos/format.py
slapos/format.py
+8
-5
No files found.
slapos/format.py
View file @
034f3166
...
@@ -37,6 +37,7 @@ import logging
...
@@ -37,6 +37,7 @@ import logging
import
netaddr
import
netaddr
import
netifaces
import
netifaces
import
os
import
os
import
glob
import
pwd
import
pwd
import
random
import
random
import
shutil
import
shutil
...
@@ -475,11 +476,13 @@ class Computer(object):
...
@@ -475,11 +476,13 @@ class Computer(object):
# get list of instance external storage if exist
# get list of instance external storage if exist
instance_external_list
=
[]
instance_external_list
=
[]
if
self
.
instance_storage_home
:
if
self
.
instance_storage_home
:
# XXX - Hard limit for storage number to 4
# get all /XXX/dataN where N is a digit
for
i
in
range
(
1
,
5
):
data_list
=
glob
.
glob
(
os
.
path
.
join
(
self
.
instance_storage_home
,
'data*'
))
storage_path
=
os
.
path
.
join
(
self
.
instance_storage_home
,
'data%s'
%
i
)
for
i
in
range
(
0
,
len
(
data_list
)):
if
os
.
path
.
exists
(
storage_path
):
data_path
=
data_list
.
pop
()
instance_external_list
.
append
(
storage_path
)
the_digit
=
os
.
path
.
basename
(
data_path
).
split
(
'data'
)[
-
1
]
if
the_digit
.
isdigit
():
instance_external_list
.
append
(
data_path
)
tap_address_list
=
[]
tap_address_list
=
[]
if
alter_network
and
self
.
tap_gateway_interface
and
create_tap
:
if
alter_network
and
self
.
tap_gateway_interface
and
create_tap
:
...
...
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