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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-12-13 16:41:31 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20121213164131-wii0p2fcv7e3en93
Tags: 2.0.1-1
* 2.0.1 Release
* Drop patches accepted upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    return 1;
60
60
  }
61
61
 
 
62
  if (!checkproxy(usercfg)) {
 
63
    return 1;
 
64
  }
 
65
 
62
66
  if (opt.debug.empty() && !usercfg.Verbosity().empty())
63
67
    Arc::Logger::getRootLogger().setThreshold(Arc::string_to_level(usercfg.Verbosity()));
64
68
 
79
83
    return 1;
80
84
  }
81
85
 
82
 
  std::list<std::string> selectedURLs = getSelectedURLsFromUserConfigAndCommandLine(usercfg, opt.clusters);
 
86
  std::list<std::string> selectedURLs;
 
87
  if (!opt.clusters.empty()) {
 
88
    selectedURLs = getSelectedURLsFromUserConfigAndCommandLine(usercfg, opt.clusters);
 
89
  }
83
90
  std::list<std::string> rejectManagementURLs = getRejectManagementURLsFromUserConfigAndCommandLine(usercfg, opt.rejectmanagement);
84
91
 
85
92
  std::list<Arc::Job> jobs;
100
107
    jobmaster.SelectByStatus(opt.status);
101
108
  }
102
109
 
103
 
  if (jobmaster.GetSelectedJobs().empty()) {
104
 
    std::cout << Arc::IString("No jobs") << std::endl;
105
 
    return 1;
106
 
  }
 
110
  //if (jobmaster.GetSelectedJobs().empty()) {
 
111
  //  std::cout << Arc::IString("No jobs") << std::endl;
 
112
  //  return 1;
 
113
  //}
107
114
 
108
115
  int retval = (int)!jobmaster.Clean();
109
116
 
136
143
    }
137
144
  }
138
145
 
 
146
 
139
147
  if (!Arc::Job::RemoveJobsFromFile(usercfg.JobListFile(), cleaned)) {
140
148
    std::cout << Arc::IString("Warning: Failed to lock job list file %s", usercfg.JobListFile()) << std::endl;
141
149
    std::cout << Arc::IString("         Run 'arcclean -s Undefined' to remove cleaned jobs from job list", usercfg.JobListFile()) << std::endl;
142
150
  }
143
151
 
 
152
  if (cleaned.empty() && notcleaned.empty()) {
 
153
    std::cout << Arc::IString("No jobs") << std::endl;
 
154
    return 1;
 
155
  }
 
156
 
144
157
  std::cout << Arc::IString("Jobs processed: %d, deleted: %d", cleaned.size()+notcleaned.size(), cleaned.size()) << std::endl;
145
158
 
146
159
  return retval;