According to DIRAC coding convention we use Camel notation for the variable names. Si, newces should rather be newCEs; queuename -> queueName, and so forth. Please, update the code accordingly. Coding conventions can be found here http://diracgrid.org/files/docs/DeveloperGuide/CodingConvention/index.html