mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-14 19:24:10 +03:00
feature #200: Fixed some minor bugs
This commit is contained in:
parent
7d96dc654d
commit
ba2d15f760
@ -477,9 +477,6 @@ int Image::disk_attribute(VectorAttribute * disk, int * index)
|
||||
transform(overwrite.begin(), overwrite.end(), overwrite.begin(),
|
||||
(int(*)(int))toupper);
|
||||
|
||||
transform(saveas.begin(), saveas.end(), saveas.begin(),
|
||||
(int(*)(int))toupper);
|
||||
|
||||
string template_bus;
|
||||
string prefix;
|
||||
|
||||
@ -502,12 +499,20 @@ int Image::disk_attribute(VectorAttribute * disk, int * index)
|
||||
map<string,string> new_disk;
|
||||
|
||||
new_disk.insert(make_pair("NAME",name));
|
||||
new_disk.insert(make_pair("OVERWRITE",overwrite));
|
||||
new_disk.insert(make_pair("SAVE_AS",saveas));
|
||||
new_disk.insert(make_pair("IID", iid.str()));
|
||||
|
||||
new_disk.insert(make_pair("SOURCE", source));
|
||||
|
||||
if (!overwrite.empty())
|
||||
{
|
||||
new_disk.insert(make_pair("OVERWRITE",overwrite));
|
||||
}
|
||||
|
||||
if (!saveas.empty())
|
||||
{
|
||||
new_disk.insert(make_pair("SAVE_AS",saveas));
|
||||
}
|
||||
|
||||
if (bus.empty())
|
||||
{
|
||||
if (!template_bus.empty())
|
||||
@ -536,7 +541,7 @@ int Image::disk_attribute(VectorAttribute * disk, int * index)
|
||||
new_disk.insert(make_pair("CLONE","NO"));
|
||||
new_disk.insert(make_pair("SAVE","YES"));
|
||||
}
|
||||
else if (saveas == "YES")
|
||||
else if (!saveas.empty())
|
||||
{
|
||||
new_disk.insert(make_pair("CLONE","YES"));
|
||||
new_disk.insert(make_pair("SAVE","YES"));
|
||||
|
@ -134,6 +134,9 @@ int ImagePool::allocate (
|
||||
|
||||
img->get_template_attribute("TYPE", type);
|
||||
|
||||
transform (type.begin(), type.end(), type.begin(),
|
||||
(int(*)(int))toupper);
|
||||
|
||||
if ( type.empty() == true )
|
||||
{
|
||||
type = default_type;
|
||||
|
Loading…
x
Reference in New Issue
Block a user