Skip to content

Commit

Permalink
Revert "types: Make transaction on report optional
Browse files Browse the repository at this point in the history
This reverts commit 1f555d9.

I need to wake up. Since v2 API cannot access reports and experimental
is gone this change is completely useless.
  • Loading branch information
Daniele Sluijters committed Oct 14, 2013
1 parent 968924b commit de15c4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
5 changes: 2 additions & 3 deletions pypuppetdb/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ class Report(object):
:type format\_: :obj:`int`
:param agent_version: The Puppet agent version.
:type agent_version: :obj:`string`
:param transaction: The UUID of this transaction, or none on API versions\
prior to v2.
:param transaction: The UUID of this transaction.
:type transaction: :obj:`string`
:ivar node: The hostname this report originated from.
Expand All @@ -96,7 +95,7 @@ class Report(object):
"""
def __init__(self, node, hash_, start, end, received, version,
format_, agent_version, transaction=None):
format_, agent_version, transaction):

self.node = node
self.hash_ = hash_
Expand Down
18 changes: 1 addition & 17 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_resource():
assert resource.parameters['mode'] == '0600'


def test_report_with_transaction():
def test_report():
report = Report('node1.puppet.board', 'hash#', '2013-08-01T09:57:00.000Z',
'2013-08-01T10:57:00.000Z', '2013-08-01T10:58:00.000Z',
'1351535883', 3, '3.2.1',
Expand All @@ -82,22 +82,6 @@ def test_report_with_transaction():
assert report.transaction == 'af9f16e3-75f6-4f90-acc6-f83d6524a6f3'


def test_report_without_transaction():
report = Report('node1.puppet.board', 'hash#', '2013-08-01T09:57:00.000Z',
'2013-08-01T10:57:00.000Z', '2013-08-01T10:58:00.000Z',
'1351535883', 3, '3.2.1')
assert report.node == 'node1.puppet.board'
assert report.hash_ == 'hash#'
assert report.start == json_to_datetime('2013-08-01T09:57:00.000Z')
assert report.end == json_to_datetime('2013-08-01T10:57:00.000Z')
assert report.received == json_to_datetime('2013-08-01T10:58:00.000Z')
assert report.version == '1351535883'
assert report.format_ == 3
assert report.agent_version == '3.2.1'
assert report.run_time == report.end - report.start
assert report.transaction is None


def test_event():
event = Event('node1.puppet.board', 'failure', '2013-08-01T10:57:00.000Z',
'hash#', '/etc/ssh/sshd_config', 'ensure', 'Nothing to say',
Expand Down

0 comments on commit de15c4e

Please sign in to comment.