Revision fc15b997 src/rm/RequestManagerClusterDelete.cc

View differences:

src/rm/RequestManagerClusterDelete.cc
23 23
void RequestManager::ClusterDelete::execute(
24 24
    xmlrpc_c::paramList const& paramList,
25 25
    xmlrpc_c::value *   const  retval)
26
{ 
26
{
27 27
    string              session;
28 28

  
29 29
    // <clid> of the cluster to delete from the HostPool
......
43 43

  
44 44
    // Only oneadmin can delete clusters
45 45
    rc = ClusterDelete::upool->authenticate(session);
46
    
46

  
47 47
    if ( rc != 0 )
48 48
    {
49 49
        goto error_authenticate;
50 50
    }
51 51

  
52

  
53
    // Check if cluster exists
54
    if ( !ClusterDelete::hpool->exists_cluster(clid) )
55
    {
56
        goto error_cluster;
57
    }
58

  
59 52
    rc = ClusterDelete::hpool->drop_cluster(clid);
60 53

  
61 54
    if ( rc != 0 )
......
78 71
    oss << "User not authorized to delete clusters";
79 72
    goto error_common;
80 73

  
81
error_cluster:
82
    oss << "Error getting cluster with CLID = " << clid;
83
    goto error_common;
84

  
85 74
error_cluster_delete:
86
    oss << "Can not delete cluster with CLID " << clid << 
75
    oss << "Can not delete cluster with CLID " << clid <<
87 76
           " from the ClusterPool, returned error code [" << rc << "]";
88 77
    goto error_common;
89 78

  

Also available in: Unified diff