fix: [update v1.5]

pull/292/head
Terrtia 2018-12-19 15:16:52 +01:00
parent 198ee97d90
commit ca47764836
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
3 changed files with 16 additions and 12 deletions

View File

@ -25,7 +25,6 @@ def auto_update_enabled(cfg):
# check if files are modify locally # check if files are modify locally
def check_if_files_modified(): def check_if_files_modified():
process = subprocess.run(['git', 'ls-files' ,'-m'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) process = subprocess.run(['git', 'ls-files' ,'-m'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if process.returncode == 0: if process.returncode == 0:
modified_files = process.stdout modified_files = process.stdout
if modified_files: if modified_files:
@ -197,7 +196,7 @@ def get_git_upper_tags_remote(current_tag, is_fork):
def update_ail(current_tag, list_upper_tags_remote, current_version_path, is_fork): def update_ail(current_tag, list_upper_tags_remote, current_version_path, is_fork):
print('{}git checkout master:{}'.format(TERMINAL_YELLOW, TERMINAL_DEFAULT)) print('{}git checkout master:{}'.format(TERMINAL_YELLOW, TERMINAL_DEFAULT))
process = subprocess.run(['git', 'checkout', 'master'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) process = subprocess.run(['git', 'checkout', 'master'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
#process = subprocess.run(['ls'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if process.returncode == 0: if process.returncode == 0:
print(process.stdout.decode()) print(process.stdout.decode())
print() print()
@ -260,10 +259,16 @@ def launch_update_version(version, roll_back_commit, current_version_path, is_fo
print('{}------------------------------------------------------------------'.format(TERMINAL_YELLOW)) print('{}------------------------------------------------------------------'.format(TERMINAL_YELLOW))
print('- Launching Update: {}{}{} -'.format(TERMINAL_BLUE, version, TERMINAL_YELLOW)) print('- Launching Update: {}{}{} -'.format(TERMINAL_BLUE, version, TERMINAL_YELLOW))
print('-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --{}'.format(TERMINAL_DEFAULT)) print('-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --{}'.format(TERMINAL_DEFAULT))
process = subprocess.run(['bash', update_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) process = subprocess.Popen(['bash', update_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
while True:
output = process.stdout.readline().decode()
if output == '' and process.poll() is not None:
break
if output:
print(output.strip())
if process.returncode == 0: if process.returncode == 0:
output = process.stdout.decode() #output = process.stdout.decode()
print(output) #print(output)
with open(current_version_path, 'w') as version_content: with open(current_version_path, 'w') as version_content:
version_content.write(version) version_content.write(version)
@ -273,8 +278,8 @@ def launch_update_version(version, roll_back_commit, current_version_path, is_fo
print('------------------------------------------------------------------{}'.format(TERMINAL_DEFAULT)) print('------------------------------------------------------------------{}'.format(TERMINAL_DEFAULT))
print() print()
else: else:
print(process.stdout.decode()) #print(process.stdout.read().decode())
print('{}{}{}'.format(TERMINAL_RED, process.stderr.decode(), TERMINAL_DEFAULT)) print('{}{}{}'.format(TERMINAL_RED, process.stderr.read().decode(), TERMINAL_DEFAULT))
print('------------------------------------------------------------------') print('------------------------------------------------------------------')
print(' {}Update Error: {}{}{}'.format(TERMINAL_RED, TERMINAL_BLUE, version, TERMINAL_DEFAULT)) print(' {}Update Error: {}{}{}'.format(TERMINAL_RED, TERMINAL_BLUE, version, TERMINAL_DEFAULT))
print('------------------------------------------------------------------') print('------------------------------------------------------------------')

View File

@ -142,9 +142,6 @@ if __name__ == '__main__':
for key in r_serv_metadata.scan_iter(key_to_rename): for key in r_serv_metadata.scan_iter(key_to_rename):
new_key = key.replace(PASTES_FOLDER, '', 1) new_key = key.replace(PASTES_FOLDER, '', 1)
# a hset with this key already exist # a hset with this key already exist
if r_serv_metadata.exists(new_key):
print(key)
else:
keys_to_rename.append((key, new_key)) keys_to_rename.append((key, new_key))
index = index + 1 index = index + 1
for key, new_key in keys_to_rename: for key, new_key in keys_to_rename:

View File

@ -30,6 +30,8 @@ while $flag_ardb; do
fi fi
done done
echo ""
echo "Fixing ARDB ..."
echo "" echo ""
bash -c "python ${AIL_HOME}/update/v1.5/Update.py" bash -c "python ${AIL_HOME}/update/v1.5/Update.py"