[2.20-Build 64] schema-transformer crash due to its does not handle 'Security-group ID" correctly
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R2.20 |
Fix Committed
|
High
|
Sachin Bansal | |||
Trunk |
Fix Committed
|
High
|
Sachin Bansal |
Bug Description
Schema transformer failed to run after rebooting node due to its does not handle 'Security-group ID" correctly.
Traceback (most recent call last):
File "/usr/bin/
load_
File "/usr/lib/
main()
File "/usr/lib/
args)
File "/usr/lib/
self.
File "/usr/lib/
func(*args, **kwargs)
File "/usr/lib/
func(*args, **kwargs)
File "/usr/lib/
transformer = SchemaTransform
File "/usr/lib/
self.reinit()
File "/usr/lib/
SecurityGro
File "/usr/lib/
cls._dict[name] = cls(name, *args)
File "/usr/lib/
self.
File "/usr/lib/
if self.name == self._sg_
File "/usr/lib/
id_str = "%(#)010d" % {'#': idx}
TypeError: %d format: a number is required, not unicode
Security group JSON;
{
"security-
{
],
},
{
],
}
],
"fq_name": [
"demo",
],
"href": "http://
"id_perms": {
},
"uuid": {
}
},
"name": "test-SG",
{
},
{
},
{
},
{
}
]
},
"uuid": "44e3f960-
}
}
information type: | Proprietary → Public |
Changed in juniperopenstack: | |
importance: | Undecided → High |
Issue can be recreated if security group id is explicitly assigned and schema is restarted.
I patched the setup to convert the security-group id to int() before calling zk api.
def set_configured_ security_ group_id( self, config_id):
self.config_ sgid = config_id get_security_ group_id( )
self. _sg_id_ allocator. delete( int(sg_ id) - SGID_MIN_ALLOC) <<<
else:
if self.name == self._sg_ id_allocator. read(int( sg_id)) : <<<
self. _sg_id_ allocator. delete( int(sg_ id)) <<<
self. obj.set_ security_ group_id( str(config_ id))
if self.config_sgid == config_id:
return
sg_id = self.obj.
if config_id:
if sg_id is not None:
if int(sg_id) > SGID_MIN_ALLOC:
else: