Skip to content

Commit fe61218

Browse files
author
Bradley A. Thornton
committed
add warning, arg as str
1 parent 8c1bbd8 commit fe61218

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

roles/resource_module/filter_plugins/to_argspec.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,10 @@ def dive(obj, required=False):
4242
result['type'] = obj['type']
4343
return result
4444

45-
def u_to_str(object, context, maxlevels, level):
46-
if isinstance(object, unicode):
47-
object = str(object)
48-
return pprint._safe_repr(object, context, maxlevels, level)
49-
5045
def to_argspec(value):
5146
data = jsonref.loads(json.dumps(value))
5247
result = dive(data['schema'])
53-
printer = pprint.PrettyPrinter()
54-
# printer.format = u_to_str
55-
return printer.pformat(result['options'])
48+
return str(result)
5649

5750

5851
class FilterModule(object):

roles/resource_module/templates/module_directory/network_os/network_os_resource.py.j2

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@
44
# (c) 2018, Red Hat, Inc.
55
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
66

7+
##############################################
8+
################# WARNING ####################
9+
##############################################
10+
###
11+
### This file is auto generated by the resource
12+
### module builder playbook.
13+
###
14+
### Do not edit this file manually.
15+
###
16+
### Changes to this file will be over written
17+
### by the resource module builder.
18+
###
19+
### Changes should be made in the model used to
20+
### generate this file or in the resource module
21+
### builder template.
22+
###
23+
##############################################
24+
##############################################
25+
##############################################
26+
727
from __future__ import absolute_import, division, print_function
828
from ansible.module_utils.basic import AnsibleModule
929
from {{ import_path }}.{{ network_os }}.config.{{ resource }}.{{ resource }} import {{ resource|capitalize }}

roles/resource_module/templates/module_utils/network_os/argspec/resource/resource.py.j2

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
#############################################
2+
################# WARNING ####################
3+
##############################################
4+
###
5+
### This file is auto generated by the resource
6+
### module builder playbook.
7+
###
8+
### Do not edit this file manually.
9+
###
10+
### Changes to this file will be over written
11+
### by the resource module builder.
12+
###
13+
### Changes should be made in the model used to
14+
### generate this file or in the resource module
15+
### builder template.
16+
###
17+
##############################################
18+
##############################################
19+
##############################################
20+
21+
122
from {{ import_path }}.network.argspec.base import ArgspecBase
223

324
class {{ resource|capitalize }}Args(ArgspecBase):

0 commit comments

Comments
 (0)