xlab-si / xopera-opera

xOpera orchestrator compliant with TOSCA YAML v1.3 in the making
https://xlab-si.github.io/xopera-docs/
Apache License 2.0
35 stars 14 forks source link

BUG: diff_instances fails if workdir_old != workdir_new #173

Closed mihaTrajbaric closed 3 years ago

mihaTrajbaric commented 3 years ago

Function opera.commands.diff.diff_instances( storage_old, workdir_old, storage_new, workdir_new,...) should be able to calculate difference between two instance states in two different workdirs.

This fails because of this two function calls:

# inside diff_instances(...)
 template_old = get_template(storage_old)
 template_new = get_template(storage_new)

and implementation of function opera.utils.get_template(storage)

# inside get_template(...)
 ast = tosca.load(Path.cwd(), PurePath(service_template))

which works only, if Path.cwd() == workdir_old == workdir_new

anzoman commented 3 years ago

@mihaTrajbaric thanks for bringing this up! I believe that this issue was known about when we released the first version of opera that included opera diff and opera update, knowing that we will have to resolve this in the future. Maybe @alexmaslenn can provide more info on how to fix this bug efficiently.

anzoman commented 3 years ago

Fixed with #195.