Skip to content

Commit

Permalink
work towards comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hmunfru committed Nov 25, 2016
1 parent fcb2688 commit 81ebd31
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ The procedure works by invoking the scripts corresponding to different phases:
expired in the next days (e.g. 7 days or less). The files ``trial_users_to_delete.txt`` and ``trial_users_to_notify.txt``
for trial users and ``community_users_to_delete.txt`` and
``community_users_to_notify.txt`` are the script outputs. This script requires the admin credential.
This script is used in the following way: phase0_generateuserlist {role}, where role is trial or community.

-phase0: ``phase0_generate_community_userlist_resources.py``. This script generate
the list of community users together with the regions where they have access in
Expand All @@ -253,15 +254,17 @@ The procedure works by invoking the scripts corresponding to different phases:
the file ``trial_users_to_notify.txt`` or ``community_users_to_notify.txt``).
The purpose of this scripts is to give
some time to users to react before their resources are deleted. This script
requires the admin credential.
requires the admin credential. This script requires the admin credential.
This script is used in the following way: phase0b_notify_users {role}, where role is trial or community.

-phase0c: ``phase0c_change_category.py``. Change the type of user from trial or
community to basic. This script requires the admin credential. It reads the file
``trial_users_to_delete.txt`` or ``community_users_to_delete.txt`. Users of
type basic cannot access the cloud portal anymore (however, the resources
created are still available).
Please, note that this script must no be executed for each region, but
only once.
only once. This script requires the admin credential.
This script is used in the following way: phase0c_change_category {role}, where role is trial or community.
-phase1, alternative 1: ``phase1_resetpasswords.py``. This script has as input
the file ``users_list.txt``. It sets a new random password for each user
Expand Down
18 changes: 11 additions & 7 deletions fiwareskuld/phase/phase1_generate_trust_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,21 @@ def generate_trust_ids(users_to_delete):

if __name__ == '__main__':
logger = log.init_logs('phase1')
if len(sys.argv) == 2:
name = sys.argv[1]
else:
if len(sys.argv) != 2:
print "This script is used in the following way: phase1_generate_trust_ids.py {role}, where role is " \
"trial or community"
exit()
if "trial" in sys.argv[1]:
name = 'trial_users_to_delete.txt'
elif "community" in sys.argv[1]:
name = 'community_users_to_delete.txt'
else:
print "Invalid role {0}".format(sys.argv[1])
exit()

try:
users_to_delete = open(name)
generate_trust_ids(users_to_delete)
except Exception:
m = 'Failed reading the file ' + name
logger.error(m)

generate_trust_ids(users_to_delete)
else:
logger = logging.getLogger(__name__)
2 changes: 1 addition & 1 deletion fiwareskuld/phase/phase2c_deletespecialports.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_users_from_file(self, file):
try:
users = open(file)
except Exception:
self.logger.error('The users_to_delete.txt file must exists')
self.logger.error('The {0} file must exists'.format(file))
sys.exit(-1)

list_users = list()
Expand Down

0 comments on commit 81ebd31

Please sign in to comment.