Fail on provisioning with date value

Dan Morphis dan at milkcarton.com
Thu Jan 10 14:01:47 EST 2019


You pulled the code from the wiki, but edited out the parts that make it
work :). You cannot count on instance ids being the same, which is why the
[FileType:3 Vendor Configuration File] filter is in the script. I didn't
write out all the code in the wiki entry to make extra work for myself :).

-dan


On Thu, Jan 10, 2019 at 6:54 AM Ramon Blanco <ramon at epic.es> wrote:

> Hi,  I’m working with genieacs and when I go to provision devices to
> download the config file with the provision script in the github’s wiki,
> the date set with Date.now() nmot working, the date always be 1970-01-01T00:00:00.000Z
> and return a fault message like this
>
>
>
> *FAULTCODE:*
>
> *9010*
>
>
>
> *FAULTSTRING:*
>
> *Could not start download*
>
>
>
>
>
> My provision script is the next one:
>
>
>
> const now = Date.now();
>
> let model = declare("Device.DeviceInfo.SerialNumber",
>
>   {value: 1}).value[0];
>
> //Map the CPE model to the config file
>
> let cfgs = {'device_sn': 'config-file.xml'};
>
>
>
> let lastConfigFile =
>
>   declare("Downloads.3.FileName",
>
>   {value: Date.now()})
>
>
>
> let configFile = cfgs[model];
>
>
>
> if (!configFile) {
>
>   //log('No config for CPE', {model: model, cfgs: cfgs});
>
>   return;
>
> }
>
>
>
> if (lastConfigFile !== undefined && lastConfigFile.value !== undefined) {
>
>   lastConfigFile = lastConfigFile.value[0];
>
> } else {
>
>   lastConfigFile = null;
>
> }
>
>
>
> if (lastConfigFile !== configFile) {
>
>   log('Upgrading config', {model: model, configFile: configFile});
>
>   declare("Downloads.3",
>
>     {path: 1}, {path: 1});
>
>   declare("Downloads.3.FileName",
>
>     {value: 1}, {value: configFile});
>
>   declare("Downloads.3.Download",
>
>     {value: 1}, {value: now});
>
> }
>
>
>
> Anyona can help me?
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20190110/f05f8e60/attachment.html>


More information about the Users mailing list