Skip to content

Commit

Permalink
Move jobdefs before jobs in parser.
Browse files Browse the repository at this point in the history
That way we het a config that first has the JobDefs and then
the Jobs which makes it easier to read for us mortals.
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent 961420f commit 95fdab1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/dird/dird_conf.c
Expand Up @@ -474,6 +474,7 @@ extern RES_ITEM msgs_items[];
RES_TABLE resources[] = {
{ "director", dir_items, R_DIRECTOR, sizeof(DIRRES) },
{ "client", cli_items, R_CLIENT, sizeof(CLIENTRES) },
{ "jobdefs", job_items, R_JOBDEFS, sizeof(JOBRES) },
{ "job", job_items, R_JOB, sizeof(JOBRES) },
{ "storage", store_items, R_STORAGE, sizeof(STORERES) },
{ "catalog", cat_items, R_CATALOG, sizeof(CATRES) },
Expand All @@ -483,7 +484,6 @@ RES_TABLE resources[] = {
{ "messages", msgs_items, R_MSGS, sizeof(MSGSRES) },
{ "counter", counter_items, R_COUNTER, sizeof(COUNTERRES) },
{ "console", con_items, R_CONSOLE, sizeof(CONRES) },
{ "jobdefs", job_items, R_JOBDEFS, sizeof(JOBRES) },
{ "device", NULL, R_DEVICE, sizeof(DEVICERES) }, /* info obtained from SD */
{ NULL, NULL, 0, 0 }
};
Expand Down Expand Up @@ -2051,8 +2051,8 @@ void dump_resource(int type, RES *ures, void sendit(void *sock, const char *fmt,
sendit(sock, "%s", buf.c_str());
}
break;
case R_JOB:
case R_JOBDEFS:
case R_JOB:
if (!ua || acl_access_ok(ua, Job_ACL, res->res_job.hdr.name)) {
res->res_job.print_config(buf);
sendit(sock, "%s", buf.c_str());
Expand Down Expand Up @@ -2387,8 +2387,8 @@ void free_resource(RES *sres, int type)
}
}
break;
case R_JOB:
case R_JOBDEFS:
case R_JOB:
if (res->res_job.backup_format) {
free(res->res_job.backup_format);
}
Expand Down Expand Up @@ -2473,7 +2473,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
/*
* Check Job requirements after applying JobDefs
*/
if (type != R_JOB && type != R_JOBDEFS) {
if (type != R_JOBDEFS && type != R_JOB) {
/*
* Ensure that all required items are present
*/
Expand Down Expand Up @@ -2569,8 +2569,8 @@ void save_resource(int type, RES_ITEM *items, int pass)
*/
res->res_store.device = res_all.res_store.device;
break;
case R_JOB:
case R_JOBDEFS:
case R_JOB:
if ((res = (URES *)GetResWithName(type, res_all.res_dir.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, _("Cannot find Job resource %s\n"),
res_all.res_dir.hdr.name);
Expand Down
2 changes: 1 addition & 1 deletion src/dird/dird_conf.h
Expand Up @@ -70,6 +70,7 @@
enum {
R_DIRECTOR = 1001,
R_CLIENT,
R_JOBDEFS,
R_JOB,
R_STORAGE,
R_CATALOG,
Expand All @@ -79,7 +80,6 @@ enum {
R_MSGS,
R_COUNTER,
R_CONSOLE,
R_JOBDEFS,
R_DEVICE,
R_FIRST = R_DIRECTOR,
R_LAST = R_DEVICE /* keep this updated */
Expand Down

0 comments on commit 95fdab1

Please sign in to comment.