Skip to content

Commit b3e51c4

Browse files
committed
examples/pod_exec.py: fix example
Use get_default_copy() API with configuration.
1 parent bf63f59 commit b3e51c4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/pod_exec.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ def exec_commands(api_instance):
117117

118118
def main():
119119
config.load_kube_config()
120-
c = Configuration()
121-
c.assert_hostname = False
120+
try:
121+
c = Configuration().get_default_copy()
122+
except AttributeError:
123+
c = Configuration()
124+
c.assert_hostname = False
122125
Configuration.set_default(c)
123126
core_v1 = core_v1_api.CoreV1Api()
124127

0 commit comments

Comments
 (0)