Misc fixes (#44649)

Correcting docs and adding a Parameters handler for description
This commit is contained in:
Tim Rupp 2018-08-24 13:58:25 -04:00 committed by GitHub
parent 639cfe3b6f
commit e4af3e7b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 10 deletions

View file

@ -101,10 +101,10 @@ EXAMPLES = r'''
RETURN = r'''
allow:
description: >
Specifies, if you have enabled SSH access, the IP address or address
range for other systems that can use SSH to communicate with this
system.
description:
- Specifies, if you have enabled SSH access, the IP address or address
range for other systems that can use SSH to communicate with this
system.
returned: changed
type: string
sample: 192.0.2.*
@ -114,16 +114,16 @@ banner:
type: string
sample: true
banner_text:
description: >
Specifies the text included on the pre-login banner that
displays when a user attempts to login to the system using SSH.
description:
- Specifies the text included on the pre-login banner that
displays when a user attempts to login to the system using SSH.
returned: changed and success
type: string
sample: This is a corporate device. Connecting to it without...
inactivity_timeout:
description: >
The number of seconds before inactivity causes an SSH
session to log out.
description:
- The number of seconds before inactivity causes an SSH
session to log out.
returned: changed
type: int
sample: 10

View file

@ -416,6 +416,13 @@ class Difference(object):
except AttributeError:
return attr1
@property
def description(self):
if self.want.description == '' and self.have.description is None:
return None
if self.want.description != self.have.description:
return self.want.description
@property
def enabled(self):
if self.want.state == 'enabled' and self.have.disabled: