Delete the local user after migrate libraries, minor review change

This commit is contained in:
HugoPoi 2019-11-06 11:55:25 +01:00
parent f86b6b6ee1
commit a8c41eb09c
3 changed files with 4 additions and 2 deletions

View file

@ -14,7 +14,7 @@
"ask": { "ask": {
"en": "User account to be migrate from the old to the new behavior" "en": "User account to be migrate from the old to the new behavior"
}, },
"example": "bob@ynh.local" "example": "bob@domain.tld"
} }
] ]
}] }]

View file

@ -172,7 +172,7 @@ sleep 5
su - $seafile_user -s /bin/bash -c "$final_path/seafile-server-$seafile_version/seafile.sh start" su - $seafile_user -s /bin/bash -c "$final_path/seafile-server-$seafile_version/seafile.sh start"
# We escape all char witch needed. # We escape all char witch needed.
ynh_replace_special_string --match_string __ADMIN_PASSWORD__ --replace_string "$admin_password" --target_file $final_path/first_launch.exp ynh_replace_special_string --match_string __ADMIN_PASSWORD__ --replace_string "$admin_password" --target_file $final_path/first_launch.exp
admin_email=$(ynh_user_get_info $admin 'mail') admin_email=$(ynh_user_get_info --username $admin --key 'mail')
su - $seafile_user -s /bin/bash -c "$final_path/first_launch.exp $final_path/seafile-server-$seafile_version $admin_email" su - $seafile_user -s /bin/bash -c "$final_path/first_launch.exp $final_path/seafile-server-$seafile_version $admin_email"
ynh_secure_remove --file="$final_path/first_launch.exp" ynh_secure_remove --file="$final_path/first_launch.exp"

View file

@ -27,3 +27,5 @@ source_repositories = seafile_api.get_owned_repo_list(source_user_email);
for repo in source_repositories: for repo in source_repositories:
seafile_api.set_repo_owner(repo.id, target_user_email) seafile_api.set_repo_owner(repo.id, target_user_email)
ccnet_api.remove_emailuser('DB', source_user_email)