- if (new_resource.Name == DEFAULT_RESOURCE_NAME)
- throw SALOME_Exception((string("Cannot modify default local resource \"") +
- DEFAULT_RESOURCE_NAME + "\"").c_str());
+ if (new_resource.Name == DEFAULT_RESOURCE_NAME){
+ ParserResourcesType default_resource = _resourcesList[DEFAULT_RESOURCE_NAME];
+ // some of the properties of the default resource shouldn't be modified
+ std::string check;
+ if( default_resource.HostName != new_resource.HostName)
+ check += "The Hostname property of the default resource can not be modified.\n";
+ if( default_resource.AppliPath != new_resource.AppliPath)
+ check += "The Applipath property of the default resource can not be modified.\n";
+ if( !new_resource.can_run_containers)
+ check += "The default resource should be able to run containers.\n";
+ if( !new_resource.can_launch_batch_jobs)
+ check += "The default resource should be able to launch batch jobs.\n";
+ if( default_resource.Protocol != new_resource.Protocol)
+ check += "The Protocol property of the default resource can not be modified.\n";
+ if(!check.empty())
+ throw ResourcesException(check);
+ }