<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: OCG DEVASC Chapter 8 DNA Center Python SDK Example 8-7 in DevNet Sandbox</title>
    <link>https://community.cisco.com/t5/devnet-sandbox/ocg-devasc-chapter-8-dna-center-python-sdk-example-8-7/m-p/4443047#M6403</link>
    <description>&lt;P&gt;Will do, Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2021 19:41:02 GMT</pubDate>
    <dc:creator>AFlack20</dc:creator>
    <dc:date>2021-08-02T19:41:02Z</dc:date>
    <item>
      <title>OCG DEVASC Chapter 8 DNA Center Python SDK Example 8-7</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/ocg-devasc-chapter-8-dna-center-python-sdk-example-8-7/m-p/4438070#M6365</link>
      <description>&lt;P&gt;This is more of a basic python question than anything.&lt;/P&gt;&lt;P&gt;Working through the Official Cert Guide for DevNet associate and in chapter 8 example 8-7 for the DNA center SDK I'm running into an issue. When looping through the devices with the (for DEVICE in DEVICES.response:) it is returning 3 additional devices that are not shown in figure 8-10 of chapter 8, with values of None. I can print this without the formatting, but python throws and exception when the formatting is present.&lt;/P&gt;&lt;P&gt;Now I was thinking I could avoid this exception with an additional if clause but for reasons I don't understand as of yet, python doesn't take the final (else:) with a following print statement.&lt;/P&gt;&lt;P&gt;First can someone please explain my error (specifically between lines 14 - 25)? Secondly is this the best method for working through this particular issue or should I just be doing error handling on the formatting exception? Thanks!&lt;/P&gt;&lt;PRE&gt;from dnacentersdk import api

DNAC = api.DNACenterAPI(username='devnetuser',
    password='Cisco123!',
    base_url='https://sandboxdnac2.cisco.com/dna')

DEVICES = DNAC.devices.get_device_list()

print('{0:25s}{1:1}{2:45}{3:1}{4:15s}'.format('Device Name', '|', \
    'Device Type', '|', 'Up Time'))

print('-'*95)

for DEVICE in DEVICES.response:
    if DEVICE.hostname == None:
        pass
    elif DEVICE.type == None:
        pass
    elif DEVICE.upTime == None:
        pass
    else:
        print(('{0:25}{1:1}{2:45}{3:1}{4:15}'.format(DEVICE.hostname, \
            '|', DEVICE.type, '|', DEVICE.upTime))

print('-'*95)

CLIENTS = DNAC.clients.get_overall_client_health(timestamp='')

print('{0:25s}{1:1}{2:45}{3:1}{4:15s}'.format('Client Category', '|', \
    'Number of Clients', '|', 'Clients Score'))

print('-'*95)

for CLIENT in CLIENTS.response:
    for score in CLIENT.scoreDetail:
        print('{0:25s}{1:1}{2:&amp;lt;45d}{3:1}{4:&amp;lt;15d}'.format(
            score.scoreCategory.value, '|', score.clientCount, '|', \
            score.scoreValue))

print('-'*95)&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Jul 2021 01:42:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/ocg-devasc-chapter-8-dna-center-python-sdk-example-8-7/m-p/4438070#M6365</guid>
      <dc:creator>AFlack20</dc:creator>
      <dc:date>2021-07-24T01:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: OCG DEVASC Chapter 8 DNA Center Python SDK Example 8-7</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/ocg-devasc-chapter-8-dna-center-python-sdk-example-8-7/m-p/4442526#M6392</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/386428"&gt;@AFlack20&lt;/a&gt;&amp;nbsp;i would post this over in the devnet cert forum here --&amp;gt;&amp;nbsp;&lt;A href="https://learningnetwork.cisco.com/s/topic/0TO3i0000008jY5GAI/devnet-certifications-community" target="_blank"&gt;https://learningnetwork.cisco.com/s/topic/0TO3i0000008jY5GAI/devnet-certifications-community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Aug 2021 16:01:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/ocg-devasc-chapter-8-dna-center-python-sdk-example-8-7/m-p/4442526#M6392</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2021-08-01T16:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: OCG DEVASC Chapter 8 DNA Center Python SDK Example 8-7</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/ocg-devasc-chapter-8-dna-center-python-sdk-example-8-7/m-p/4443047#M6403</link>
      <description>&lt;P&gt;Will do, Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 19:41:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/ocg-devasc-chapter-8-dna-center-python-sdk-example-8-7/m-p/4443047#M6403</guid>
      <dc:creator>AFlack20</dc:creator>
      <dc:date>2021-08-02T19:41:02Z</dc:date>
    </item>
  </channel>
</rss>

