diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py index 51ce952..02eb367 100644 --- a/napalm_s350/s350.py +++ b/napalm_s350/s350.py @@ -256,7 +256,10 @@ class S350Driver(NetworkDriver): domainname = domainname['domain_name'] if domainname == 'Domain': domainname = '' - fqdn = '{0}.{1}'.format(hostname, domainname) + if domainname == '' and hostname == '': + fqdn = '' + else: + fqdn = '{0}.{1}'.format(hostname, domainname) # interface_list interfaces = [] diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/expected_result.json similarity index 100% rename from test/unit/mocked_data/test_get_facts/SG500-28-K9/expected_result.json rename to test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/expected_result.json diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_hosts.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_hosts.txt similarity index 100% rename from test/unit/mocked_data/test_get_facts/SG500-28-K9/show_hosts.txt rename to test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_hosts.txt diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_interface_status.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_interface_status.txt similarity index 100% rename from test/unit/mocked_data/test_get_facts/SG500-28-K9/show_interface_status.txt rename to test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_interface_status.txt diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_inventory.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_inventory.txt similarity index 100% rename from test/unit/mocked_data/test_get_facts/SG500-28-K9/show_inventory.txt rename to test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_inventory.txt diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_system.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_system.txt similarity index 100% rename from test/unit/mocked_data/test_get_facts/SG500-28-K9/show_system.txt rename to test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_system.txt diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_version.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_version.txt similarity index 100% rename from test/unit/mocked_data/test_get_facts/SG500-28-K9/show_version.txt rename to test/unit/mocked_data/test_get_facts/SG500-28-K9-no_hostname/show_version.txt