~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/clients/compute/arcclean.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-11-29 13:39:10 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20131129133910-altaxrfowczzl2ev
Tags: 4.0.0-1
4.0.0 Release (Closes: #715131) (LP: #1049798)

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
  std::list<std::string> rejectManagementURLs = getRejectManagementURLsFromUserConfigAndCommandLine(usercfg, opt.rejectmanagement);
92
92
 
93
93
  std::list<Arc::Job> jobs;
94
 
  Arc::JobInformationStorageXML jobList(usercfg.JobListFile());
95
 
  if (( opt.all && !jobList.ReadAll(jobs, rejectManagementURLs)) ||
96
 
      (!opt.all && !jobList.Read(jobs, jobidentifiers, selectedURLs, rejectManagementURLs))) {
 
94
  Arc::JobInformationStorage *jobstore = createJobInformationStorage(usercfg);
 
95
  if (jobstore != NULL && !jobstore->IsStorageExisting()) {
 
96
    logger.msg(Arc::ERROR, "Job list file (%s) doesn't exist", usercfg.JobListFile());
 
97
    delete jobstore;
 
98
    return 1;
 
99
  }
 
100
  if (jobstore == NULL ||
 
101
      ( opt.all && !jobstore->ReadAll(jobs, rejectManagementURLs)) ||
 
102
      (!opt.all && !jobstore->Read(jobs, jobidentifiers, selectedURLs, rejectManagementURLs))) {
97
103
    logger.msg(Arc::ERROR, "Unable to read job information from file (%s)", usercfg.JobListFile());
 
104
    delete jobstore;
98
105
    return 1;
99
106
  }
100
107
 
149
156
  }
150
157
 
151
158
 
152
 
  if (!jobList.Remove(cleaned)) {
153
 
    std::cout << Arc::IString("Warning: Failed to lock job list file %s", usercfg.JobListFile()) << std::endl;
 
159
  if (!jobstore->Remove(cleaned)) {
 
160
    std::cout << Arc::IString("Warning: Failed to write job information to file (%s)", usercfg.JobListFile()) << std::endl;
154
161
    std::cout << Arc::IString("         Run 'arcclean -s Undefined' to remove cleaned jobs from job list", usercfg.JobListFile()) << std::endl;
155
162
  }
 
163
  delete jobstore;
156
164
 
157
165
  if (cleaned.empty() && notcleaned.empty()) {
158
166
    std::cout << Arc::IString("No jobs") << std::endl;