Skip to content

Commit 944662a

Browse files
committed
Add auto_raise to replace verb
1 parent 86954eb commit 944662a

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

ansible/rebuild_module.digest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ebc832e4dbef87f17cd2446a7ee00bf0 -
1+
27df65c40a0dfac2e55523f73af3ab13 -

ansible/roles/openshift_client_python/library/openshift_client_python.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openshift/base_verbs.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,9 @@ def apply(str_dict_model_apiobject_or_list_thereof, overwrite=False, cmd_args=No
533533
auto_raise=True):
534534
"""
535535
Applies the specifies resource(s) on the server.
536-
:param str_dict_model_apiobject_or_list_thereof:
536+
:param str_dict_model_apiobject_or_list_thereof: The definition of one or more API object.
537+
Can be string containing json or yaml, a python dict, an openshift.Model, or an openshift.APIObject.
538+
You can also provide a list containing multiple of these elements to update.
537539
:param overwrite: If --overwrite should be sent to apply.
538540
:param cmd_args: Additional apply arguments
539541
:param fetch_resource_versions: If True, before trying to apply the resources, a get operation will be used to
@@ -584,7 +586,16 @@ def apply(str_dict_model_apiobject_or_list_thereof, overwrite=False, cmd_args=No
584586
auto_raise=auto_raise)
585587

586588

587-
def replace(str_dict_model_apiobject_or_list_thereof, force=False, cmd_args=None):
589+
def replace(str_dict_model_apiobject_or_list_thereof, force=False, cmd_args=None, auto_raise=True):
590+
"""
591+
:param str_dict_model_apiobject_or_list_thereof: The definition of one or more API object.
592+
Can be string containing json or yaml, a python dict, an openshift.Model, or an openshift.APIObject.
593+
You can also provide a list containing multiple of these elements to update.
594+
:param force: Whether to send the --force argument to oc replace.
595+
:param cmd_args: Additional arguments for the verb.
596+
:param auto_raise: If True, errors from oc will raise an exception.
597+
:return: A selector for the updated objects and Result.
598+
"""
588599
base_args = list()
589600
if force:
590601
base_args.append('--force')
@@ -605,7 +616,8 @@ def replace(str_dict_model_apiobject_or_list_thereof, force=False, cmd_args=None
605616
return __new_objects_action_selector("replace",
606617
cmd_args=["-f", "-", base_args, cmd_args],
607618
stdin_obj=m,
608-
no_namespace=namespace_detected)
619+
no_namespace=namespace_detected,
620+
auto_raise=auto_raise)
609621

610622

611623
def build_configmap_dict(configmap_name, dir_path_or_paths=None, dir_ext_include=None, data_map=None, obj_labels=None):

0 commit comments

Comments
 (0)