Breaking Changes - Early Preview 2 (v.0.4.0)¶
New Argument snapshot_parameters
¶
A new argument snapshot_parameters
was added to the following staged plugin operations:
This argument will allow the end user to indicate to the plugin whether or not to initiate a full ingestion for a dSource. More details about the new argument are here.
What is affected¶
This argument applies only to staged plugins. The plugin's source code will have to be updated for the following staged plugin operations:
- Staged Linked Source Pre-Snapshot: This plugin operation is optional and will need to be updated if the plugin implements it.
- Staged Linked Source Post-Snapshot: This plugin operation is required and will need to be updated.
How does it fail¶
build will fail with the following error message if the new argument is not added to the affected staged plugin operations:
$ dvp build
Error: Number of arguments do not match in method staged_post_snapshot. Expected: ['staged_source', 'repository', 'source_config', 'snapshot_parameters'], Found: ['repository', 'source_config', 'staged_source'].
Error: Number of arguments do not match in method staged_pre_snapshot. Expected: ['staged_source', 'repository', 'source_config', 'snapshot_parameters'], Found: ['repository', 'source_config', 'staged_source'].
0 Warning(s). 2 Error(s).
BUILD FAILED.
How to fix it¶
Update the affected staged plugin operations to include the new argument snapshot_parameters
.
- Previous releases
from dlpx.virtualization.platform import Plugin
plugin = Plugin()
@plugin.linked.pre_snapshot()
def linked_pre_snapshot_prior(staged_source, repository, source_config):
# This was the function signature prior to 0.4.0
pass
@plugin.linked.post_snapshot()
def linked_post_snapshot_prior(staged_source, repository, source_config):
# This was the function signature prior to 0.4.0
return SnapshotDefinition()
- 0.4.0
from dlpx.virtualization.platform import Plugin
plugin = Plugin()
@plugin.linked.pre_snapshot()
def linked_pre_snapshot_040(staged_source, repository, source_config, snapshot_parameters):
# Updated function signature in 0.4.0
pass
@plugin.linked.post_snapshot()
def linked_post_snapshot_040(staged_source, repository, source_config, snapshot_parameters):
# Updated function signature in 0.4.0
return SnapshotDefinition()
StagedSource Properties Modified¶
Properties of the StagedSource class were modified:
connection
was renamed tosource_connection
.staged_connection
was added to allow connecting to the staging environment.
This will enable plugins to connect to both the source and staging environments. More details about these properties are here.
What is affected¶
This change applies only to staged plugins.
Required Changes¶
The plugin's source code will have to be updated for any staged plugin operations that accesses the connection
propery of a StagedSource object.
Optional Changes¶
The plugin can choose to use the new staged_connection
property to connect to the staging environment of a dSource.
How does it fail¶
Any Delphix Engine operation that calls a plugin operation that has not been fixed would fail with the following stack trace as part of the output of the user exception:
How to fix it¶
Update any staged plugin operations that access the renamed property.
- Previous releases
from dlpx.virtualization.platform import Plugin
from dlpx.virtualization import libs
plugin = Plugin()
@plugin.linked.pre_snapshot()
def linked_pre_snapshot_prior(staged_source, repository, source_config):
# Property name was 'connection' was the name of the property for staged_source prior to 0.4.0
libs.run_bash(staged_source.connection, 'date')
- 0.4.0
from dlpx.virtualization.platform import Plugin
from dlpx.virtualization import libs
plugin = Plugin()
@plugin.linked.pre_snapshot()
def linked_pre_snapshot_prior(staged_source, repository, source_config):
# Property name was updated to 'source_connection' in 0.4.0
libs.run_bash(staged_source.source_connection, 'date')