diff --git a/pyeapi/client.py b/pyeapi/client.py index 16bf300..de5c8a8 100644 --- a/pyeapi/client.py +++ b/pyeapi/client.py @@ -718,7 +718,10 @@ def _chunkify( self, config, indent=0 ): last parsed (sub)section, which in turn may contain sub-sections """ def is_subsection_present( section, indent ): - return any( [line[ indent ] == ' ' for line in section] ) + try: + return any( [line[ indent ] == ' ' for line in section] ) + except IndexError: + return False sections = {} key = None for line in config.splitlines( keepends=True )[ indent > 0: ]: