|
2 | 2 | delagent: Remove an upload from the DB and repository
|
3 | 3 |
|
4 | 4 | Copyright (C) 2007-2013 Hewlett-Packard Development Company, L.P.
|
| 5 | + Copyright (C) 2015-2016 Siemens AG |
5 | 6 |
|
6 | 7 | This program is free software; you can redistribute it and/or
|
7 | 8 | modify it under the terms of the GNU General Public License
|
@@ -68,37 +69,41 @@ void writeMessageAfterDelete(char *kind, long id, char *user_name, int returnedC
|
68 | 69 | {
|
69 | 70 | fprintf(stdout, "The %s '%ld' is deleted by the user '%s'.\n", kind, id, user_name);
|
70 | 71 | }
|
| 72 | + else if (2 == returnedCode) |
| 73 | + { |
| 74 | + fprintf(stdout, "The %s '%ld' could not be found by the user '%s'.\n", kind, id, user_name); |
| 75 | + } |
71 | 76 | else
|
72 | 77 | {
|
73 |
| - LOG_FATAL("You '%s' does not have the permsssion to delete the %s '%ld', or the %s '%ld' does not exist.\n", user_name, kind, id, kind, id); |
74 |
| - exit(returnedCode); |
| 78 | + fprintf(stdout, "Deletion failed: user '%s' does not have the permsssion to delete the %s '%ld', or the %s '%ld' does not exist.\n", user_name, kind, id, kind, id); |
| 79 | + exit(-1); |
75 | 80 | }
|
76 | 81 | }
|
77 | 82 |
|
78 | 83 | /**
|
79 | 84 | * \brief main function for the delagent
|
80 | 85 | *
|
81 | 86 | * There are 2 ways to use the delagent agent:
|
82 |
| - * 1. Command Line :: delete/list upload from the command line |
| 87 | + * 1. Command Line :: delete/list upload/folder/license from the command line |
83 | 88 | * 2. Agent Based :: run from the scheduler
|
84 | 89 | *
|
85 | 90 | * +-----------------------+
|
86 | 91 | * | Command Line Analysis |
|
87 | 92 | * +-----------------------+
|
88 | 93 | *
|
89 | 94 | * List or delete uploads.
|
90 |
| - * -h :: help (print this message), then exit. |
91 |
| - * -i :: Initialize the DB |
92 |
| - * -u :: List uploads IDs. |
93 |
| - * -U # :: Delete upload ID. |
94 |
| - * -L # :: Delete ALL licenses associated with upload ID. |
95 |
| - * -f :: List folder IDs. |
96 |
| - * -F # :: Delete folder ID and all uploads under this folder. |
97 |
| - * -T :: TEST -- do not update the DB or delete any files (just pretend). |
98 |
| - * -v :: Verbose (-vv for more verbose). |
99 |
| - * -V :: print the version info, then exit. |
| 95 | + * -h :: help (print this message), then exit. |
| 96 | + * -i :: Initialize the DB |
| 97 | + * -u :: List uploads IDs. |
| 98 | + * -U # :: Delete upload ID. |
| 99 | + * -L # :: Delete ALL licenses associated with upload ID. |
| 100 | + * -f :: List folder IDs. |
| 101 | + * -F # :: Delete folder ID and all uploads under this folder. |
| 102 | + * -T :: TEST -- do not update the DB or delete any files (just pretend). |
| 103 | + * -v :: Verbose (-vv for more verbose). |
| 104 | + * -V :: print the version info, then exit. |
100 | 105 | * -c SYSCONFDIR :: Specify the directory for the system configuration.
|
101 |
| - * --user # :: user name |
| 106 | + * --user # :: user name |
102 | 107 | * --password # :: password
|
103 | 108 | *
|
104 | 109 | * +----------------------+
|
|
0 commit comments