Commit 034f3166 authored by Alain Takoudjou's avatar Alain Takoudjou

slapos format: drop limit of 4 data storage directory

parent 29ea31cf
...@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment