mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 06:31:23 -07:00
PEP8 fixes: Ansible source_control module (#32323)
* PEP8 fixes: Ansible source_control module * Some more cleanup changes * More cleanups * Fix copyright statement
This commit is contained in:
parent
d9ef167e78
commit
fcab13a668
4 changed files with 57 additions and 76 deletions
|
@ -1,58 +1,53 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# (c) 2013, André Paramés <git@andreparames.com>
|
||||
# Copyright: (c) 2013, André Paramés <git@andreparames.com>
|
||||
# Based on the Git module by Michael DeHaan <michael.dehaan@gmail.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['preview'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = u'''
|
||||
---
|
||||
module: bzr
|
||||
author: "André Paramés (@andreparames)"
|
||||
author:
|
||||
- André Paramés (@andreparames)
|
||||
version_added: "1.1"
|
||||
short_description: Deploy software (or files) from bzr branches
|
||||
description:
|
||||
- Manage I(bzr) branches to deploy files or software.
|
||||
options:
|
||||
name:
|
||||
required: true
|
||||
aliases: [ 'parent' ]
|
||||
description:
|
||||
- SSH or HTTP protocol address of the parent branch.
|
||||
aliases: [ parent ]
|
||||
required: yes
|
||||
dest:
|
||||
required: true
|
||||
description:
|
||||
- Absolute path of where the branch should be cloned to.
|
||||
required: yes
|
||||
version:
|
||||
required: false
|
||||
default: "head"
|
||||
description:
|
||||
- What version of the branch to clone. This can be the
|
||||
bzr revno or revid.
|
||||
default: head
|
||||
force:
|
||||
required: false
|
||||
default: "no"
|
||||
choices: [ 'yes', 'no' ]
|
||||
description:
|
||||
- If C(yes), any modified files in the working
|
||||
tree will be discarded. Before 1.9 the default
|
||||
value was "yes".
|
||||
value was C(yes).
|
||||
type: bool
|
||||
default: 'no'
|
||||
executable:
|
||||
required: false
|
||||
default: null
|
||||
version_added: "1.4"
|
||||
description:
|
||||
- Path to bzr executable to use. If not supplied,
|
||||
the normal mechanism for resolving binary paths will be used.
|
||||
version_added: '1.4'
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
@ -139,23 +134,24 @@ class Bzr(object):
|
|||
args_list = ["revert"]
|
||||
return self._command(args_list, check_rc=True, cwd=self.dest)
|
||||
|
||||
|
||||
# ===========================================
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
dest=dict(required=True, type='path'),
|
||||
name=dict(required=True, aliases=['parent']),
|
||||
version=dict(default='head'),
|
||||
force=dict(default='no', type='bool'),
|
||||
executable=dict(default=None),
|
||||
argument_spec=dict(
|
||||
dest=dict(type='path', required=True),
|
||||
name=dict(type='str', required=True, aliases=['parent']),
|
||||
version=dict(type='str', default='head'),
|
||||
force=dict(type='bool', default='no', type='bool'),
|
||||
executable=dict(type='str'),
|
||||
)
|
||||
)
|
||||
|
||||
dest = module.params['dest']
|
||||
parent = module.params['name']
|
||||
dest = module.params['dest']
|
||||
parent = module.params['name']
|
||||
version = module.params['version']
|
||||
force = module.params['force']
|
||||
force = module.params['force']
|
||||
bzr_path = module.params['executable'] or module.get_bin_path('bzr', True)
|
||||
|
||||
bzrconfig = os.path.join(dest, '.bzr', 'branch', 'branch.conf')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue