action #58490
closed400 bad request error msg popup after load_templates --update
0%
Description
Try to do update operation but 400 back.
linux-4360:/usr/share/openqa/script # ./dump_templates --host localhost --group "cc" --json --full >bb.json
linux-4360:/usr/share/openqa/script # ./load_templates bb.json --update
{
JobGroups => [
{
group_name => "cc",
template => "defaults:\n x86_64:\n machine: 64bit\n priority: 50\nproducts:\n aa-aa-Server-DVD-x86_64:\n distri: aa\n flavor: Server-DVD\n version: aa\nscenarios:\n x86_64:\n aa-aa-Server-DVD-x86_64:\n - '1'\n",
},
],
JobTemplates => [
{
group_name => "cc",
machine => { name => "64bit" },
prio => 50,
product => {
arch => "x86_64",
distri => "aa",
flavor => "Server-DVD",
group => "aa-aa-Server-DVD",
version => "aa",
},
test_suite => { name => 1 },
},
],
Machines => [
{
backend => "qemu",
name => "64bit",
settings => [
{ key => "HDDSIZEGB", value => 20 },
{ key => "QEMUCPU", value => "qemu64" },
{ key => "VIRTIO_CONSOLE", value => 1 },
{ key => "WORKER_CLASS", value => "qemu_x86_64" },
],
},
],
Products => [
{
arch => "x86_64",
distri => "aa",
flavor => "Server-DVD",
settings => [],
version => "aa",
},
],
TestSuites => [{ name => 1, settings => [] }],
}
ERROR: 400 - Bad Request
{
error => [
"Job template name '1' with aa-aa-Server-DVD-x86_64 and 64bit is already used in job group 'cc'",
],
error_status => 400,
id => 3,
}
{
JobGroups => { added => 0, of => 1 },
JobTemplates => { added => 0, of => 1 },
Machines => { added => 1, of => 1 },
Products => { added => 1, of => 1 },
TestSuites => { added => 1, of => 1 },
}
Updated by Xiaojing_liu about 5 years ago
- Subject changed from 400 bad request error msg popup after dump_templates --update to 400 bad request error msg popup after load_templates --update
Updated by coolgw about 5 years ago
After further check, i found it indeed can update content if i change some content in json file(such as change setting value of test suite).
But if i change the setting of JobTemplates, then it can not take effect.
{
"JobTemplates" : [
{
"group_name" : "bb",
"test_suite" : {
"name" : "111"
},
"settings" : [
{
"key" : "ADDONS",
"value" : "xxx" <==== try to change this value and try loadtemplate, it will not take effect.
},
{
"key" : "BOOTFROM",
"value" : "xxx1"
}
],
Updated by livdywan about 5 years ago
On a general note for the future, I'd find it helpful if the steps didn't rely on a local instance and code markup were used (I need to reconstruct the YAML document from the command output as seen when editing the description, and guess what the test suites are). You can do that by adding "```" before and after the code.
defaults:
x86_64:
machine: 64bit
priority: 50
products:
aa-aa-Server-DVD-x86_64:
distri: aa
flavor: Server-DVD
version: aa
scenarios:
x86_64:
aa-aa-Server-DVD-x86_64:
- '1'
Updated by livdywan about 5 years ago
- Category set to Regressions/Crashes
- Status changed from New to Workable
- Target version set to Current Sprint
It seems like this can be reproduced pretty easily with a random group, or maybe I was lucky. But it seems that there's a bug in detecting unique job templates even when nothing was changed.
Updated by Xiaojing_liu about 5 years ago
- Category deleted (
Regressions/Crashes) - Assignee set to Xiaojing_liu
Updated by Xiaojing_liu about 5 years ago
Updated by Xiaojing_liu about 5 years ago
- Status changed from Workable to Feedback
Updated by Xiaojing_liu about 5 years ago
- Status changed from Feedback to Resolved