mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Adding unit tests for ConnectionInformation (v2)
This commit is contained in:
@@ -88,14 +88,6 @@ class ConnectionInformation:
|
||||
if play:
|
||||
self.set_play(play)
|
||||
|
||||
def __repr__(self):
|
||||
value = "CONNECTION INFO:\n"
|
||||
fields = self._get_fields()
|
||||
fields.sort()
|
||||
for field in fields:
|
||||
value += "%20s : %s\n" % (field, getattr(self, field))
|
||||
return value
|
||||
|
||||
def set_play(self, play):
|
||||
'''
|
||||
Configures this connection information instance with data from
|
||||
@@ -199,7 +191,7 @@ class ConnectionInformation:
|
||||
for attr in ('connection', 'remote_user', 'become', 'become_user', 'become_pass', 'become_method', 'environment', 'no_log'):
|
||||
if hasattr(task, attr):
|
||||
attr_val = getattr(task, attr)
|
||||
if attr_val:
|
||||
if attr_val is not None:
|
||||
setattr(new_info, attr, attr_val)
|
||||
|
||||
# finally, use the MAGIC_VARIABLE_MAPPING dictionary to update this
|
||||
|
||||
Reference in New Issue
Block a user