@@ -669,21 +669,15 @@ def __init__(self, paths):
669669 self .config_files = {}
670670 self .config_merged = None
671671 if hasattr (paths , 'read' ):
672- self .load_config_from_fileish (paths )
672+ self ._load_config_from_file_like_object (paths )
673673 else :
674- for path in paths .split (ENV_KUBECONFIG_PATH_SEPARATOR ):
675- if path :
676- path = os .path .expanduser (path )
677- if os .path .exists (path ):
678- self .paths .append (path )
679- self .load_config (path )
680- self .config_saved = copy .deepcopy (self .config_files )
674+ self ._load_config_from_file_path (paths )
681675
682676 @property
683677 def config (self ):
684678 return self .config_merged
685679
686- def load_config_from_fileish (self , string ):
680+ def _load_config_from_file_like_object (self , string ):
687681 if hasattr (string , 'getvalue' ):
688682 config = yaml .safe_load (string .getvalue ())
689683 else :
@@ -693,6 +687,15 @@ def load_config_from_fileish(self, string):
693687 self .config_merged = copy .deepcopy (config )
694688 # doesn't need to do any further merging
695689
690+ def _load_config_from_file_path (self , string ):
691+ for path in string .split (ENV_KUBECONFIG_PATH_SEPARATOR ):
692+ if path :
693+ path = os .path .expanduser (path )
694+ if os .path .exists (path ):
695+ self .paths .append (path )
696+ self .load_config (path )
697+ self .config_saved = copy .deepcopy (self .config_files )
698+
696699 def load_config (self , path ):
697700 with open (path ) as f :
698701 config = yaml .safe_load (f )
0 commit comments