From 9af3b032fb5361f9fecd37acd094768ff0f5e452 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Thu, 6 Sep 2018 12:16:01 -0400 Subject: [PATCH] Set default description if not set --- pvc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pvc.py b/pvc.py index 6dc673f1..1d392808 100755 --- a/pvc.py +++ b/pvc.py @@ -93,7 +93,10 @@ def stopZKConnection(zk_conn): def getDomainMainDetails(parsed_xml): # Get the information we want from it duuid = str(parsed_xml.uuid) - ddescription = str(parsed_xml.description) + try: + ddescription = str(parsed_xml.description) + except AttributeError: + ddescription = "N/A" dname = str(parsed_xml.name) dmemory = str(parsed_xml.memory) dmemory_unit = str(parsed_xml.memory.attrib['unit'])