Exemple #1
0
 def _update_user_data(self):
     if 'filesystems' in self.app.ud:
         old_fs_list = self.app.ud.get('filesystems') or []
         new_fs_list = []
         # clear 'services' and replace with the new format
         for fs in old_fs_list:
             svc_roles = ServiceRole.from_string_array(fs['roles'])
             if ServiceRole.GALAXY_TOOLS in svc_roles and ServiceRole.GALAXY_DATA in svc_roles:
                 # This condition should only occur in new configs, but check
                 # added so that things work properly even if run against a new config
                 # Only works for default configs though...
                 new_fs_list.append(fs)
             elif ServiceRole.GALAXY_TOOLS in svc_roles:
                 pass  # skip adding the galaxy tools file system, no longer needed.
             else:
                 if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
                     fs['roles'] = ServiceRole.to_string_array([ServiceRole.GALAXY_TOOLS,
                         ServiceRole.GALAXY_DATA])
                     new_fs_list.append(fs)
                 else:
                     new_fs_list.append(fs)
         self.app.ud['filesystems'] = new_fs_list
     self.app.ud['deployment_version'] = 2
     self.app.ud.pop('galaxy_home', None)  # TODO: Galaxy home is always reset
                                           # to default. Discuss implications
     return True
Exemple #2
0
 def _update_user_data(self):
     if 'filesystems' in self.app.config.user_data:
         old_fs_list = self.app.config.user_data.get('filesystems') or []
         new_fs_list = []
         # clear 'services' and replace with the new format
         for fs in old_fs_list:
             svc_roles = ServiceRole.from_string_array(fs['roles'])
             if ServiceRole.GALAXY_TOOLS in svc_roles and ServiceRole.GALAXY_DATA in svc_roles:
                 # This condition should only occur in new configs, but check
                 # added so that things work properly even if run against a new config
                 # Only works for default configs though...
                 new_fs_list.append(fs)
             elif ServiceRole.GALAXY_TOOLS in svc_roles:
                 pass  # skip adding the galaxy tools file system, no longer needed.
             else:
                 if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
                     fs['roles'] = ServiceRole.to_string_array([ServiceRole.GALAXY_TOOLS,
                                                                ServiceRole.GALAXY_DATA])
                     new_fs_list.append(fs)
                 else:
                     new_fs_list.append(fs)
         self.app.config.user_data['filesystems'] = new_fs_list
     self.app.config.user_data['deployment_version'] = 2
     self.app.config.user_data.pop('galaxy_home', None)  # TODO: Galaxy home is always reset to default. Discuss implications
     return True