Exemplo n.º 1
0
 def set_password(self, addr, username, password):
     user_path = UserManager._find_user_path_(addr, username)
     if not user_path:
         return 'username ' + username + 'of addr ' + addr + ' not found', None
     user_dict = UserManager._load_user_dict_(user_path, username)
     user_dict['password'] = PasswordManager.encrypt(password)
     UserManager._save_user_dict_(user_dict, user_path, username)
     return self._build_user_list_(addr)
 def set_password(self, addr, password):
     component_path = ComponentManager._find_component_path_(addr)
     if not component_path:
         return 'Component address ' + addr + ' not found', None
     component_dict = ComponentManager._load_component_dict_(
         component_path, addr)
     component_dict['password'] = PasswordManager.encrypt(password)
     ComponentManager._save_component_dict_(component_dict, component_path,
                                            addr)
     return self._return_list_()
Exemplo n.º 3
0
    def set_password(self, addr, password):
        owner_dict = OwnerManager._load_owner_dict_(ConfigRepo.FABIC_CA_SRC_REPO + os.sep + addr, addr)
        owner_dict['password'] = PasswordManager.encrypt(password)
        OwnerManager._save_owner_dict_(owner_dict, ConfigRepo.FABIC_CA_SRC_REPO + os.sep + addr, addr)

        return None, self.build_owner_list()