runpromises: support software releases older than slapos 1.0.118

Before slapos commit a184cca8b (Try to reuse existing file to avoid
excessive IO on update + other minor optimisations, 2019-06-17), which
started to be used in profiles in 65acdca0d (Release slapos.cookbook
(1.0.118), 2019-08-13), the promise plugins did not contain

    import sys
    sys.path[0:0] = (..., )

but there was an extra import statement:

    import sys
    import json
    sys.path[0:0] = (..., )

slapos.core >= 1.7 was not able to process such promises, because the
code introspecting these promises assumed that the second node of the
AST was the assignment, which is incorrect in the old promises because
it was another import.

To accomodate both cases, use the value from the first assignment.

We also change to use ast.literal_eval for safety.
14 jobs for fix/promises_pre1.0.118 in 0 seconds (queued for 1 second)
Status Job ID Name Coverage
  External
passed SlapOS.Eggs.UnitTest-Jerome.Python2

00:13:45

passed SlapOS.Eggs.UnitTest-Jerome.Python3

00:15:37

running SlapOS.Eggs.UnitTest-Master.Python2

24324:18:10

running SlapOS.Eggs.UnitTest-Master.Python3

24324:18:08

passed SlapOS.Eggs.UnitTest-Jerome.Python2

00:12:32

passed SlapOS.Eggs.UnitTest-Jerome.Python2

00:13:36

passed SlapOS.Eggs.UnitTest-Jerome.Python2

00:13:32

passed SlapOS.Eggs.UnitTest-Jerome.Python2

00:13:30

passed SlapOS.Eggs.UnitTest-Jerome.Python2

00:12:26

passed SlapOS.Eggs.UnitTest-Jerome.Python3

00:16:55

passed SlapOS.Eggs.UnitTest-Jerome.Python3

00:13:27

passed SlapOS.Eggs.UnitTest-Jerome.Python3

00:13:04

passed SlapOS.Eggs.UnitTest-Jerome.Python3

00:13:23

passed SlapOS.Eggs.UnitTest-Jerome.Python3

00:13:14