summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/add_storage.py
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/LinHES-system/add_storage.py')
-rw-r--r--abs/core/LinHES-system/add_storage.py38
1 files changed, 26 insertions, 12 deletions
diff --git a/abs/core/LinHES-system/add_storage.py b/abs/core/LinHES-system/add_storage.py
index 1987dff..1f166b1 100644
--- a/abs/core/LinHES-system/add_storage.py
+++ b/abs/core/LinHES-system/add_storage.py
@@ -438,10 +438,23 @@ def search_for_match(system_drive,known_drive_list):
return match_drive
-def prompt_to_add(current_drive):
+def prompt_to_add(current_drive,destruction = True):
loop = True
+ if destruction :
+ prompt = '''
+ Adding the drive will remove all contents on the drive.
+
+ Do you wish enable this drive for MythTV storage(Y/N)?:
+ '''
+ else:
+ prompt = '''
+ ** Preserving existing data **
+ will not format or partition
+
+ Do you wish enable this drive for MythTV storage(Y/N)?:
+ '''
while loop:
- str1 = raw_input("\n Adding the drive will remove all contents on the drive. \n Do you wish enable this drive for MythTV storage(Y/N)?:")
+ str1 = raw_input(prompt)
if str1 in ['Y','N','y','n']:
loop = False
@@ -474,7 +487,7 @@ def prompt_sg(dir_be_sg,dir_fe_sg):
#check for backend storage groups
if dir_be_sg != True:
loop = True
- print "@@@@@@@@@@@@@@@@@@@@@@"
+ print "*" * 40
prompt_string='''
Backend Storage Groups are used for things like
TV Recordings and database backups.
@@ -501,7 +514,7 @@ def prompt_sg(dir_be_sg,dir_fe_sg):
#now for frontend storage groups
if dir_fe_sg != True:
loop = True
- print "++++++++++++++++++++++++"
+ print "+" * 20
prompt_string='''
Frontend Storage Groups are used for videos.
The content on these storage groups will
@@ -576,7 +589,7 @@ def main(scan_only, destruction, no_mount, install_call , dir_fe_sg, dir_be_sg):
print " location: %s" %i.block_path
print " size: %s " %i.device_size
- if prompt_to_add(i) :
+ if prompt_to_add(i,destruction) :
print "\n Disk will be added to the storage pool!"
process_list.append(i)
else:
@@ -631,11 +644,12 @@ def main(scan_only, destruction, no_mount, install_call , dir_fe_sg, dir_be_sg):
i.format_disk()
i.add_fstab()
i.mount_disk(no_mount)
- if destruction == True:
- if dir_fe_sg == True:
- i.mkdirs(FS_LIST_FE)
- if dir_be_sg == True:
- i.mkdirs(FS_LIST_BE)
+ #if destruction == True:
+
+ if dir_fe_sg == True:
+ i.mkdirs(FS_LIST_FE)
+ if dir_be_sg == True:
+ i.mkdirs(FS_LIST_BE)
i.set_disk_num(disk_num)
i.write_config()
@@ -871,7 +885,7 @@ def reconstruct_mounts(no_mount):
def usage():
help='''\n
Add storage is designed to find and setup new disks for mythtv usage.
- It's a powerfull that could destroy data if not used correctly, so please be careful.
+ It's a powerfull tool that could destroy data if not used correctly, so please be careful.
Normal operations include (in this order):
Partition the disk
Format the disk
@@ -884,7 +898,7 @@ def usage():
options:
--no_mount : Do not mount the disk, only add it to /etc/fstab and create the dir.
- --no_destruction: Will not partition or format the disk
+ --no_destruction: Will not partition or format the disk. This can be used to import disks from other systems.
--new_init : Erase the list of new disks and rescan.
--report : will scan the disks and print out if it found new storage.
--add_fe_sg : Will only create the storage group dir for videos..excludes tv