Skip to content

Empty DiffSync instance evaluates as false #84

@smk4664

Description

@smk4664

Environment

  • DiffSync version: 1.3.0
  • Python version: 3.6

Observed Behavior

When using diffsync within Nautobot-plugin-ssot, it would be nice to allow the Destination (Target) to have no data.

An empty DiffSync() evaluates to False. This causes a failure to proceed to the Diff.

the base DiffSync class has a len() method, an object’s default bool() casting must use that to determine whether it evaluates as truthy:

diffsync = DiffSync()
bool(diffsync)
False
diffsync.add(DiffSyncModel())
bool(diffsync)
True

Expected Behavior

diffsync proceeds to diff and then syncs data to the Destination (Target).

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted by the maintainers team for implementationtype: bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions