opennebula-5.4.1-nodelusergroupowning.diff
opennebula-5.4.1-nodelusergroupowning/src/group/GroupPool.cc 2017-10-17 11:39:12.503868090 -0500 | ||
---|---|---|
202 | 202 |
return -3; |
203 | 203 |
} |
204 | 204 | |
205 |
// Return an error if there are any resources owned by this group |
|
206 |
/// Images |
|
207 |
ImagePool *ipool = Nebula::instance().get_ipool(); |
|
208 |
ostringstream gidSearchPattern; |
|
209 |
std::vector<int> imageIdsOwnedByGroup; |
|
210 | ||
211 |
gidSearchPattern << "gid = " << group->get_oid(); |
|
212 |
ipool->search(imageIdsOwnedByGroup, "image_pool", gidSearchPattern.str()); |
|
213 |
if (imageIdsOwnedByGroup.size() > 0) { |
|
214 |
ostringstream oss; |
|
215 |
oss << "Group " << group->get_oid(); |
|
216 |
oss << " owns images"; |
|
217 |
error_msg = oss.str(); |
|
218 |
NebulaLog::log("GROUP", Log::ERROR, error_msg); |
|
219 |
return -4; |
|
220 |
} |
|
221 | ||
222 |
// Pass deletion to the next layer of abstraction |
|
205 | 223 |
rc = group->drop(db); |
206 | 224 | |
207 | 225 |
if( rc != 0 ) |