Skip to content

Commit

Permalink
Add equal function to MachineType
Browse files Browse the repository at this point in the history
  • Loading branch information
whynick1 committed Dec 10, 2019
1 parent 70b6cf8 commit 3202c48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ducktape/cluster/remoteaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,3 +775,9 @@ def __repr__(self):
def __str__(self):
return "MachineType(cpu core:{}, memory(GB):{}, boot disk(GB):{}, additional disks(GB):{})" \
.format(self.cpu_core, self.mem_size_gb, self.disk_size_gb, self.additional_disks)

def __eq__(self, other):
return other and other.__dict__ == self.__dict__

def __hash__(self):
return hash(tuple(sorted(self.__dict__.items())))

0 comments on commit 3202c48

Please sign in to comment.