Skip to content

Commit 831208f

Browse files
author
Taras Keryk
committed
Fixed profile naming
1 parent 8629a5a commit 831208f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

config/plugins/barefoot.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ def profile(profile):
5656
# Update configuration
5757
config_db = ConfigDBConnector()
5858
config_db.connect()
59-
if no_arch_information:
60-
profile += '_profile'
61-
else:
62-
profile = profile + '_' + chip_family
59+
profile += '_profile' if no_arch_information else '_' + chip_family
6360
config_db.mod_entry('DEVICE_METADATA', 'localhost', {'p4_profile': profile})
6461

6562
subprocess.run(['systemctl', 'restart', 'swss'], check=True)

show/plugins/barefoot.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ def profile():
3030
r' | sed s/install_\\\(.\*\\\)_tofino\\\(.\*\\\)/\\1/', check=True, shell=True)
3131

3232
# Check if profile naming format contains tofino family information
33-
suffix = '_profile'
34-
if '_tofino' in subprocess.check_output(['docker', 'exec', '-it', 'syncd', 'ls', '/opt/bfn']).strip().decode():
35-
suffix = '_' + chip_family
33+
output = subprocess.check_output(['docker', 'exec', '-it', 'syncd', 'ls', '/opt/bfn']).strip().decode()
34+
suffix = '_' + chip_family if '_tofino' in output else '_profile'
3635

3736
# Check supported profiles
3837
opts = ''

0 commit comments

Comments
 (0)