Merge remote-tracking branch 'ms/esel_devpath_fixes'

Change-Id: I433fd0c50f14dd9be178223957ec63c581ac288d
diff --git a/README.md b/README.md
index 75063ce..48ba644 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@
 
 ### Project Administrators
 
-* [`autobump`](infra/): Update commit IDs in bitbake recipes to bring in new changes
+* [`openbmc-autobump.py`](infra/): Update commit IDs in bitbake recipes to bring in new changes
 
 ## Sending patches
 
diff --git a/emilyshaffer/cla-signers/cla-signers b/emilyshaffer/cla-signers/cla-signers
index 09e6816..a3a42a4 100644
--- a/emilyshaffer/cla-signers/cla-signers
+++ b/emilyshaffer/cla-signers/cla-signers
@@ -1,16 +1,19 @@
-Updated Thu May 31 11:18:12 EDT 2018
+Updated Wed Sep 19 11:53:54 EDT 2018
+
 Aditya Saripalli
 Adriana Kobylak
 Agustin Ortiz
 Alexander Amelkin
 Alexander Filippov
 Alexander Soldatov
+Alissa Lee
 Alistair Popple
 Amithash Prasad
 Andres Oportus
 Andrew Geissler
 Andrew Jeffery
 Andy Mao
+Anthony Wilson
 Artem Senichev
 Ben Wei
 Brad Bishop
@@ -22,18 +25,21 @@
 Cezary Golder
 Charles Hofer
 Cheng C Yang
+Chip Dart
 Chris Austen
 Chris Bostic
 David J Cobbley
 David Nickel
 Dawid Frycki
 Deepak Kodihalli
+Derick Montague
 Dhruvaraj Subhashchandran
 Ed Tanous
 Edward James
 Emily Shaffer
 Emmanuel Pando
 Ernesto Cacique
+Evan Lojewski
 George Keishing
 Gunnar Mills
 Haiyue Wang
@@ -68,6 +74,7 @@
 Luis Diaz
 Lukasz Golawski
 ManojKiran Eda
+Margie Villanueva
 Marri Devender Rao
 Matthew Barth
 Matthew Spinler
@@ -85,6 +92,7 @@
 Rahul Maheshwari
 Ratan Gupta
 Ravindra Rao
+Rebecca Shaw
 Reed Frandsen
 Richard Marian Thomaiyar
 Robert Lippert
@@ -94,6 +102,7 @@
 Sampa Misra
 Saqib Khan
 Sathyajith Sanjeevaraya
+Shakeeb Pasha
 Sherad Khetan (CLA Manager)
 Sivas SRR 
 Sridevi Ramesh
@@ -102,6 +111,7 @@
 Steven Sombar
 Sunil Mamillapalli
 Suraj Jitindar Singh
+Susan Jasinski
 Sweta Potthuri
 Tom Joseph
 Vernon Mauery
diff --git a/infra/autobump.pl b/infra/autobump.pl
deleted file mode 100755
index bec2f82..0000000
--- a/infra/autobump.pl
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env perl
-
-# Contributors Listed Below - COPYRIGHT 2017
-# [+] International Business Machines Corp.
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# permissions and limitations under the License.
-
-use strict;
-use File::Basename qw/basename/;
-
-my $metas_to_search = "meta-phosphor meta-openbmc-machines meta-openbmc-bsp";
-my $master_project = "openbmc";
-my $server = "https://gerrit.openbmc-project.xyz";
-
-system("cd $master_project && git fetch origin && git checkout origin/master");
-
-open(FILES, "cd $master_project && git grep -l -e \"_URI\" --and -e \"github\" -- $metas_to_search |");
-
-my @to_update = ();
-
-while(my $file = <FILES>)
-{
-    chomp $file;
-
-    my $entry = {};
-    $entry->{FILE} = "$file";
-    $entry->{BRANCH} = "master";
-
-    open(FILE, "$master_project/$entry->{FILE}");
-    while(my $line = <FILE>)
-    {
-        chomp $line;
-
-        if ($line =~ m/SRCREV ?.*=/)
-        {
-            if ($line =~ m/"([0-9a-f]*)"/)
-            {
-                $entry->{SRCREV} = $1;
-            }
-        }
-        elsif ($line =~ m/_URI/ and $line =~ m/github.com\/$master_project\//)
-        {
-            $line =~ s/.*$master_project\//$master_project\//;
-            $line =~ s/"//g;
-            $line =~ s/\.git$//;
-            $entry->{SRC_URI} = $line;
-            print "$file : $line\n";
-        }
-    }
-    close FILE;
-
-    if (exists $entry->{SRC_URI} and exists $entry->{SRCREV})
-    {
-        push @to_update, $entry;
-    }
-}
-
-foreach my $entry (@to_update)
-{
-    my $project = $entry->{SRC_URI};
-    $project =~ s/\//%2F/g;
-    my $revision =
-        `curl -s $server/projects/$project/branches/$entry->{BRANCH}  | \
-         grep revision`;
-
-    if (not $revision =~ m/revision/)
-    {
-        next;
-    }
-    if ($revision =~ m/$entry->{SRCREV}/)
-    {
-        print "$entry->{SRC_URI} is up to date @ $entry->{SRCREV}\n";
-        next;
-    }
-
-    $revision =~ m/"([0-9a-f]*)"/;
-    $revision = $1;
-
-    print "$entry->{SRC_URI} needs to be updated\n";
-    print "\t$entry->{SRCREV} -> $revision\n";
-
-    my $changeId = `echo autobump $entry->{FILE} $entry->{SRCREV} $revision | git hash-object -t blob --stdin`;
-    chomp $changeId;
-    $changeId =~ s/[ \t]*//;
-    $changeId = "I$changeId";
-
-    my $change =
-        `curl -s $server/changes/$master_project%2F$master_project~$entry->{BRANCH}~$changeId | \
-         grep change_id`;
-
-    if ($change =~ m/$changeId/)
-    {
-        print "\t$changeId already present.\n";
-        next;
-    }
-
-    system("cd $master_project && git checkout origin/master --force &&".
-            " sed -i \"s/$entry->{SRCREV}/$revision/\" $entry->{FILE} &&".
-            " git add $entry->{FILE}");
-
-    open(COMMIT, "| cd $master_project && git commit -s -F -");
-    print COMMIT (basename $entry->{FILE}).": bump version\n";
-    print COMMIT "\n";
-    print COMMIT "Change-Id: $changeId\n";
-    close(COMMIT);
-
-    system("cd $master_project && git push origin HEAD:refs/for/master/autobump");
-
-}
diff --git a/infra/openbmc-autobump.py b/infra/openbmc-autobump.py
new file mode 100755
index 0000000..6716f4f
--- /dev/null
+++ b/infra/openbmc-autobump.py
@@ -0,0 +1,195 @@
+#!/usr/bin/env python3
+
+# Contributors Listed Below - COPYRIGHT 2018
+# [+] International Business Machines Corp.
+#
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+
+import argparse
+import os
+import sh
+import sys
+
+git = sh.git.bake('--no-pager')
+
+
+def log(msg, args):
+    if args.noisy:
+        sys.stderr.write('{}\n'.format(msg))
+
+
+def git_clone_or_reset(local_name, remote, args):
+    if not os.path.exists(local_name):
+        log('cloning into {}...'.format(local_name), args)
+        git.clone(remote, local_name)
+    else:
+        log('{} exists, updating...'.format(local_name), args)
+        git.fetch(_cwd=local_name)
+        git.reset('--hard', 'FETCH_HEAD', _cwd=local_name)
+
+
+def extract_sha_from_recipe(recipe):
+    with open(recipe) as fp:
+        project = None
+        sha = None
+
+        for line in fp:
+            if 'SRCREV' in line:
+                sha = line.split('=')[-1].replace('"', '').strip()
+            elif '_URI' in line and 'github.com/openbmc' in line:
+                uri = line.split(';')[0].split('=')[-1].replace('"', '').strip()
+                project = uri.split('/')[-1].replace('.git', '')
+
+            if project and sha:
+                return (project, sha)
+
+        raise RuntimeError('No SRCREV or URI found in {}'.format(recipe))
+
+
+def find_candidate_recipes(meta, args):
+    remote_fmt_args = (args.ssh_config_host, meta)
+    remote = 'ssh://{}/openbmc/{}'.format(*remote_fmt_args)
+    try:
+        git_clone_or_reset(meta, remote, args)
+    except sh.ErrorReturnCode as e:
+        log('{}'.format(e), args)
+        return []
+
+    grep_args = ['-l', '-e', '_URI', '--and', '-e', 'github.com/openbmc']
+    try:
+        return git.grep(*grep_args, _cwd=meta).stdout.decode('utf-8').split()
+    except sh.ErrorReturnCode_1:
+        pass
+    except sh.ErrorReturnCode as e:
+        log('{}'.format(e), args)
+
+    return []
+
+
+def find_and_process_bumps(meta, args):
+    candidate_recipes = find_candidate_recipes(meta, args)
+
+    for recipe in candidate_recipes:
+        full_recipe_path = os.path.join(meta, recipe)
+        recipe_basename = os.path.basename(full_recipe_path)
+        project_name, recipe_sha = extract_sha_from_recipe(full_recipe_path)
+
+        remote_fmt_args = (args.ssh_config_host, project_name)
+        remote = 'ssh://{}/openbmc/{}'.format(*remote_fmt_args)
+        ls_remote_args = [remote, 'refs/heads/{}'.format(args.branch)]
+        try:
+            project_sha = git('ls-remote', *ls_remote_args)
+            project_sha = project_sha.stdout.decode('utf-8').split()[0]
+        except sh.ErrorReturnCode as e:
+            log('{}'.format(e), args)
+            continue
+
+        if project_sha == recipe_sha:
+            message_args = (recipe_basename, recipe_sha[:10])
+            print('{} is up to date ({})'.format(*message_args))
+            continue
+
+        change_id = 'autobump {} {} {}'.format(recipe, recipe_sha, project_sha)
+        hash_object_args = ['-t', 'blob', '--stdin']
+        change_id = git(sh.echo(change_id), 'hash-object', *hash_object_args)
+        change_id = 'I{}'.format(change_id.strip())
+
+        query_args = ['query', 'change:{}'.format(change_id)]
+        gerrit_query_result = args.gerrit(*query_args)
+        gerrit_query_result = gerrit_query_result.stdout.decode('utf-8')
+
+        if (change_id in gerrit_query_result):
+            message_args = (recipe_basename, change_id)
+            print('{} {} already exists'.format(*message_args))
+            continue
+
+        message_args = (recipe_basename, recipe_sha[:10], project_sha[:10])
+        print('{} updating from {} to {}'.format(*message_args))
+
+        remote_args = (args.ssh_config_host, project_name)
+        remote = 'ssh://{}/openbmc/{}'.format(*remote_args)
+        git_clone_or_reset(project_name, remote, args)
+
+        try:
+            revlist = '{}..{}'.format(recipe_sha, project_sha)
+            shortlog = git.shortlog(revlist, _cwd=project_name)
+            shortlog = shortlog.stdout.decode('utf-8')
+        except sh.ErrorReturnCode as e:
+            log('{}'.format(e), args)
+            continue
+
+        reset_args = ['--hard', 'origin/{}'.format(args.branch)]
+        git.reset(*reset_args, _cwd=meta)
+
+        recipe_content = None
+        with open(full_recipe_path) as fd:
+            recipe_content = fd.read()
+
+        recipe_content = recipe_content.replace(recipe_sha, project_sha)
+        with open(full_recipe_path, 'w') as fd:
+            fd.write(recipe_content)
+
+        git.add(recipe, _cwd=meta)
+
+        commit_summary_args = (project_name, recipe_sha[:10], project_sha[:10])
+        commit_msg = '{}: srcrev bump {}..{}'.format(*commit_summary_args)
+        commit_msg += '\n\n{}'.format(shortlog)
+        commit_msg += '\n\nChange-Id: {}'.format(change_id)
+
+        git.commit(sh.echo(commit_msg), '-s', '-F', '-', _cwd=meta)
+
+        push_args = ['origin', 'HEAD:refs/for/{}/autobump'.format(args.branch)]
+        git.push(*push_args, _cwd=meta)
+
+
+def main():
+    app_description = '''OpenBMC bitbake recipe bumping tool.
+
+Find bitbake metadata files (recipes) that use the git fetcher
+and check the project repository for newer revisions.
+
+Generate commits that update bitbake metadata files with SRCREV.
+
+Push generated commits to the OpenBMC Gerrit instance for review.
+    '''
+    parser = argparse.ArgumentParser(
+        description=app_description,
+        formatter_class=argparse.RawDescriptionHelpFormatter)
+
+    parser.set_defaults(branch='master')
+    parser.add_argument(
+        '-m', '--meta-repository', dest='meta_repository', action='append',
+        help='meta repository to check for updates')
+    parser.add_argument(
+        '-v', '--verbose', dest='noisy', action='store_true',
+        help='enable verbose status messages')
+    parser.add_argument(
+        'ssh_config_host', metavar='SSH_CONFIG_HOST_ENTRY',
+        help='SSH config host entry for Gerrit connectivity')
+
+    args = parser.parse_args()
+    setattr(args, 'gerrit', sh.ssh.bake(args.ssh_config_host, 'gerrit'))
+
+    metas = getattr(args, 'meta_repository')
+    if metas is None:
+        metas = args.gerrit('ls-projects', '-m', 'meta-')
+        metas = metas.stdout.decode('utf-8').split()
+        metas = [os.path.split(x)[-1] for x in metas]
+
+    for meta in metas:
+        find_and_process_bumps(meta, args)
+
+
+if __name__ == '__main__':
+    sys.exit(0 if main() else 1)
diff --git a/leiyu/obmc-utils/README.md b/leiyu/obmc-utils/README.md
index 5b1e643..161a29f 100644
--- a/leiyu/obmc-utils/README.md
+++ b/leiyu/obmc-utils/README.md
@@ -3,3 +3,28 @@
 * `upload_and_update.py`
 A tool to upload a tarball to TFTP server and update BMC with it.
 **Note**: It uses legacy methods to update BMC so it may break in future when the code update is refactored.
+
+* `sensor_yaml_config.py`
+A tool to help write IPMI sensor yaml config.
+**Note**: This script requires python3.6 or above.
+
+   * To sort the yaml config:
+   ```
+   sensor_yaml_config.py -i <input.yaml> -o <output.yaml>
+   ```
+   * To add the missing enityID, entityInstance, and sensorNamePattern:
+   ```
+   sensor_yaml_config.py -i <input.yaml> -o <output.yaml> -f
+   ```
+   * To add missing core/dimm temperature sensors based on RPT (generated by OpenPOWER op-build):
+   ```
+   sensor_yaml_config.py -i <input.yaml> -o <output.yaml> -f -r <machine.rpt>
+   ```
+   * To generate a sensor map from example yaml config, which could be used for future:
+   ```
+   sensor_yaml_config.py -i <sample.yaml> -o <sensor_map.yaml> -g
+   ```
+   * To generate a DCMI sensor json config, which is used by phosphor-ipmi-config:
+   ```
+   sensor_yaml_config.py -i <input.yaml> -o <output.json> -d
+   ```
diff --git a/leiyu/obmc-utils/sensor_map.yaml b/leiyu/obmc-utils/sensor_map.yaml
new file mode 100644
index 0000000..4af0405
--- /dev/null
+++ b/leiyu/obmc-utils/sensor_map.yaml
@@ -0,0 +1,750 @@
+? !!python/tuple
+- /org/open_power/control/occ0
+- !!python/tuple [org.open_power.OCC.Status]
+: {entityID: 210, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /org/open_power/control/occ1
+- !!python/tuple [org.open_power.OCC.Status]
+: {entityID: 210, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /org/open_power/control/volatile
+- !!python/tuple [xyz.openbmc_project.Object.Enable]
+: {entityID: 33, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 3, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 3, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core0
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core1
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core10
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core11
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core12
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core13
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core14
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core15
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core16
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core17
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core18
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core19
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core2
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core20
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core21
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core22
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core23
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core3
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core4
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core5
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core6
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core7
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core8
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu0/core9
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 3, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core0
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core1
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core10
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core11
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core12
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core13
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core14
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core15
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core16
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core17
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core18
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core19
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core2
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core20
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core21
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core22
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core23
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core3
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core4
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core5
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core6
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core7
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core8
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/cpu1/core9
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 208, sensorNamePattern: nameParentLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm0
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm1
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm10
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm11
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm12
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm13
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm14
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm15
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm2
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm3
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm4
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm5
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm6
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm7
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm8
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/dimm9
+- !!python/tuple [xyz.openbmc_project.Inventory.Item, xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/gv100card0
+- !!python/tuple [xyz.openbmc_project.Inventory.Decorator.Replaceable, xyz.openbmc_project.Inventory.Item,
+  xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/gv100card1
+- !!python/tuple [xyz.openbmc_project.Inventory.Decorator.Replaceable, xyz.openbmc_project.Inventory.Item,
+  xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/gv100card2
+- !!python/tuple [xyz.openbmc_project.Inventory.Decorator.Replaceable, xyz.openbmc_project.Inventory.Item,
+  xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/gv100card3
+- !!python/tuple [xyz.openbmc_project.Inventory.Decorator.Replaceable, xyz.openbmc_project.Inventory.Item,
+  xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/gv100card4
+- !!python/tuple [xyz.openbmc_project.Inventory.Decorator.Replaceable, xyz.openbmc_project.Inventory.Item,
+  xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /system/chassis/motherboard/gv100card5
+- !!python/tuple [xyz.openbmc_project.Inventory.Decorator.Replaceable, xyz.openbmc_project.Inventory.Item,
+  xyz.openbmc_project.State.Decorator.OperationalStatus]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/control/host0/TPMEnable
+- !!python/tuple [xyz.openbmc_project.Control.TPM.Policy]
+: {entityID: 3, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/control/host0/auto_reboot
+- !!python/tuple [xyz.openbmc_project.Control.Boot.RebootPolicy]
+: {entityID: 33, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/control/host0/turbo_allowed
+- !!python/tuple [xyz.openbmc_project.Control.Host.TurboAllowed]
+: {entityID: 3, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/current/ps0_output_current
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/current/ps1_output_current
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan0_0
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan0_1
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan1_0
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan1_1
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan2_0
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan2_1
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan3_0
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/fan_tach/fan3_1
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 29, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/fan_disk_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/p0_io_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/p0_mem_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/p0_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/p1_io_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/p1_mem_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/p1_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/ps0_input_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/ps1_input_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/power/total_power
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/ambient
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 64, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm0_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm10_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm11_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm12_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm13_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm14_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm15_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm1_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm2_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm3_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm4_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm5_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm6_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm7_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm8_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/dimm9_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 32, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu0_core_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu0_mem_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 217, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu1_core_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu1_mem_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 217, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu2_core_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu2_mem_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 217, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu3_core_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu3_mem_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 217, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu4_core_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu4_mem_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 217, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu5_core_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 216, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/gpu5_mem_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 217, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core0_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core10_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core11_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core12_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core13_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core14_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core15_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core16_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core17_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core18_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core19_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core1_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core20_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core21_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core22_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core23_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core2_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core3_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core4_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core5_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core6_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core7_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core8_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_core9_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 218, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core0_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core10_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core11_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core12_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core13_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core14_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core15_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core16_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core17_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core18_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core19_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core1_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core20_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core21_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core22_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core23_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core2_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core3_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core4_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core5_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core6_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core7_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core8_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_core9_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 208, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/p1_vdd_temp
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 218, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/temperature/pcie
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 35, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/voltage/ps0_input_voltage
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/voltage/ps0_output_voltage
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/voltage/ps1_input_voltage
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/sensors/voltage/ps1_output_voltage
+- !!python/tuple [xyz.openbmc_project.Sensor.Value]
+: {entityID: 10, sensorNamePattern: nameLeaf}
+? !!python/tuple
+- /xyz/openbmc_project/state/host0
+- !!python/tuple [xyz.openbmc_project.Control.Boot.RebootAttempts]
+: {entityID: 34, sensorNamePattern: nameProperty}
+? !!python/tuple
+- /xyz/openbmc_project/state/host0
+- !!python/tuple [xyz.openbmc_project.State.Boot.Progress]
+: {entityID: 34, sensorNamePattern: nameProperty}
+? !!python/tuple
+- /xyz/openbmc_project/state/host0
+- !!python/tuple [xyz.openbmc_project.State.OperatingSystem.Status]
+: {entityID: 35, sensorNamePattern: nameProperty}
diff --git a/leiyu/obmc-utils/sensor_yaml_config.py b/leiyu/obmc-utils/sensor_yaml_config.py
new file mode 100755
index 0000000..358bd65
--- /dev/null
+++ b/leiyu/obmc-utils/sensor_yaml_config.py
@@ -0,0 +1,410 @@
+#!/usr/bin/env python3
+
+import yaml
+import argparse
+
+from typing import NamedTuple
+
+
+class RptSensor(NamedTuple):
+    name: str
+    entityId: int
+    typeId: int
+    evtType: int
+    sensorId: int
+    fru: int
+    targetPath: str
+
+
+sampleDimmTemp = {
+    'bExp': 0,
+    'entityID': 32,
+    'entityInstance': 2,
+    'interfaces': {
+        'xyz.openbmc_project.Sensor.Value': {
+            'Value': {
+                'Offsets': {
+                    255: {
+                        'type': 'int64_t'
+                    }
+                }
+            }
+        }
+    },
+    'multiplierM': 1,
+    'mutability': 'Mutability::Write|Mutability::Read',
+    'offsetB': -127,
+    'path': '/xyz/openbmc_project/sensors/temperature/dimm0_temp',
+    'rExp': 0,
+    'readingType': 'readingData',
+    'scale': -3,
+    'sensorNamePattern': 'nameLeaf',
+    'sensorReadingType': 1,
+    'sensorType': 1,
+    'serviceInterface': 'org.freedesktop.DBus.Properties',
+    'unit': 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC'
+}
+sampleCoreTemp = {
+    'bExp': 0,
+    'entityID': 208,
+    'entityInstance': 2,
+    'interfaces': {
+        'xyz.openbmc_project.Sensor.Value': {
+            'Value': {
+                'Offsets': {
+                    255: {
+                        'type': 'int64_t'
+                    }
+                }
+            }
+        }
+    },
+    'multiplierM': 1,
+    'mutability': 'Mutability::Write|Mutability::Read',
+    'offsetB': -127,
+    'path': '/xyz/openbmc_project/sensors/temperature/p0_core0_temp',
+    'rExp': 0,
+    'readingType': 'readingData',
+    'scale': -3,
+    'sensorNamePattern': 'nameLeaf',
+    'sensorReadingType': 1,
+    'sensorType': 1,
+    'serviceInterface': 'org.freedesktop.DBus.Properties',
+    'unit': 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC'
+}
+samplePower = {
+    'bExp': 0,
+    'entityID': 10,
+    'entityInstance': 13,
+    'interfaces': {
+        'xyz.openbmc_project.Sensor.Value': {
+            'Value': {
+                'Offsets': {
+                    255: {
+                        'type': 'int64_t'
+                    }
+                }
+            }
+        }
+    },
+    'multiplierM': 2,
+    'offsetB': 0,
+    'path': '/xyz/openbmc_project/sensors/power/p0_power',
+    'rExp': 0,
+    'readingType': 'readingData',
+    'scale': -6,
+    'sensorNamePattern': 'nameLeaf',
+    'sensorReadingType': 1,
+    'sensorType': 8,
+    'serviceInterface': 'org.freedesktop.DBus.Properties',
+    'unit': 'xyz.openbmc_project.Sensor.Value.Unit.Watts'
+}
+
+sampleDcmiSensor = {
+    "instance": 1,
+    "dbus": "/xyz/openbmc_project/sensors/temperature/p0_core0_temp",
+    "record_id": 91
+}
+
+
+def openYaml(f):
+    return yaml.load(open(f))
+
+
+def saveYaml(y, f, safe=True):
+    if safe:
+        noaliasDumper = yaml.dumper.SafeDumper
+        noaliasDumper.ignore_aliases = lambda self, data: True
+        yaml.dump(y, open(f, "w"), default_flow_style=False,
+                  Dumper=noaliasDumper)
+    else:
+        yaml.dump(y, open(f, "w"))
+
+
+def getEntityIdAndNamePattern(p, intfs, m):
+    key = (p, intfs)
+    match = m.get(key, None)
+    if match is None:
+        # Workaround for P8's occ sensors, where the path look like
+        # /org/open_power/control/occ_3_0050
+        if '/org/open_power/control/occ' in p \
+           and 'org.open_power.OCC.Status' in intfs:
+            return (210, 'nameLeaf')
+        raise Exception('Unable to find sensor', key, 'from map')
+    return (m[key]['entityID'], m[key]['sensorNamePattern'])
+
+
+# Global entity instances
+entityInstances = {}
+
+
+def getEntityInstance(id):
+    instanceId = entityInstances.get(id, 0)
+    instanceId = instanceId + 1
+    entityInstances[id] = instanceId
+    print("EntityId:", id, "InstanceId:", instanceId)
+    return instanceId
+
+
+def loadRpt(rptFile):
+    sensors = []
+    with open(rptFile) as f:
+        next(f)
+        next(f)
+        for line in f:
+            fields = line.strip().split('|')
+            fields = list(map(str.strip, fields))
+            sensor = RptSensor(
+                fields[0],
+                int(fields[2], 16) if fields[2] else None,
+                int(fields[3], 16) if fields[3] else None,
+                int(fields[4], 16) if fields[4] else None,
+                int(fields[5], 16) if fields[5] else None,
+                int(fields[7], 16) if fields[7] else None,
+                fields[9])
+            # print(sensor)
+            sensors.append(sensor)
+    return sensors
+
+
+def getDimmTempPath(p):
+    # Convert path like: /sys-0/node-0/motherboard-0/dimmconn-0/dimm-0
+    # to: /xyz/openbmc_project/sensors/temperature/dimm0_temp
+    import re
+    dimmconn = re.search(r'dimmconn-\d+', p).group()
+    dimmId = re.search(r'\d+', dimmconn).group()
+    return '/xyz/openbmc_project/sensors/temperature/dimm{}_temp'.format(dimmId)
+
+
+def getMembufTempPath(name):
+    # Convert names like MEMBUF0_Temp or CENTAUR0_Temp
+    # to: /xyz/openbmc_project/sensors/temperature/membuf0_temp
+    # to: /xyz/openbmc_project/sensors/temperature/centaur0_temp
+    return '/xyz/openbmc_project/sensors/temperature/{}'.format(name.lower())
+
+
+def getCoreTempPath(name, p):
+    # For different rpts:
+    # Convert path like:
+    #   /sys-0/node-0/motherboard-0/proc_socket-0/module-0/p9_proc_s/eq0/ex0/core0 (for P9)
+    # to: /xyz/openbmc_project/sensors/temperature/p0_core0_temp
+    # or name like: CORE0_Temp (for P8)
+    # to: /xyz/openbmc_project/sensors/temperature/core0_temp (for P8)
+    import re
+    if 'p9_proc' in p:
+        splitted = p.split('/')
+        socket = re.search(r'\d+', splitted[4]).group()
+        core = re.search(r'\d+', splitted[9]).group()
+        return '/xyz/openbmc_project/sensors/temperature/p{}_core{}_temp'.format(socket, core)
+    else:
+        core = re.search(r'\d+', name).group()
+        return '/xyz/openbmc_project/sensors/temperature/core{}_temp'.format(core)
+
+
+def getPowerPath(name):
+    # Convert name like Proc0_Power
+    # to: /xyz/openbmc_project/sensors/power/p0_power
+    import re
+    r = re.search(r'\d+', name)
+    if r:
+        index = r.group()
+    else:
+        # Handle cases like IO_A_Power, Storage_Power_A
+        r = re.search(r'_[A|B|C|D]', name).group()[-1]
+        index = str(ord(r) - ord('A'))
+    prefix = 'p'
+    m = None
+    if 'memory_proc' in name.lower():
+        prefix = None
+        m = 'centaur'
+    elif 'pcie_proc' in name.lower():
+        m = 'pcie'
+    elif 'io' in name.lower():
+        m = 'io'
+    elif 'fan' in name.lower():
+        m = 'fan'
+    elif 'storage' in name.lower():
+        m = 'disk'
+    elif 'total' in name.lower():
+        prefix = None
+        m = 'total'
+    elif 'proc' in name.lower():
+        # Default
+        pass
+
+    ret = '/xyz/openbmc_project/sensors/power/'
+    if prefix:
+        ret = ret + prefix + index
+    if m:
+        if prefix:
+            ret = ret + '_' + m
+        else:
+            ret = ret + m
+    if prefix is None:
+        ret = ret + index
+    ret = ret + '_power'
+    return ret
+
+
+def getDimmTempConfig(s):
+    r = sampleDimmTemp.copy()
+    r['entityInstance'] = getEntityInstance(r['entityID'])
+    r['path'] = getDimmTempPath(s.targetPath)
+    return r
+
+
+def getMembufTempConfig(s):
+    r = sampleDimmTemp.copy()
+    r['entityID'] = 0xD1
+    r['entityInstance'] = getEntityInstance(r['entityID'])
+    r['path'] = getMembufTempPath(s.name)
+    return r
+
+
+def getCoreTempConfig(s):
+    r = sampleCoreTemp.copy()
+    r['entityInstance'] = getEntityInstance(r['entityID'])
+    r['path'] = getCoreTempPath(s.name, s.targetPath)
+    return r
+
+
+def getPowerConfig(s):
+    r = samplePower.copy()
+    r['entityInstance'] = getEntityInstance(r['entityID'])
+    r['path'] = getPowerPath(s.name)
+    return r
+
+
+def isCoreTemp(p):
+    import re
+    m = re.search(r'p\d+_core\d+_temp', p)
+    return m is not None
+
+
+def getDcmiSensor(i, sensor):
+    import re
+    path = sensor['path']
+    name = path.split('/')[-1]
+    m = re.findall(r'\d+', name)
+    socket, core = int(m[0]), int(m[1])
+    instance = socket * 24 + core + 1
+    r = sampleDcmiSensor.copy()
+    r['instance'] = instance
+    r['dbus'] = path
+    r['record_id'] = i
+    return r
+
+
+def saveJson(data, f):
+    import json
+    with open(f, 'w') as outfile:
+        json.dump(data, outfile, indent=4)
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description='Yaml tool for updating ipmi sensor yaml config')
+    parser.add_argument('-i', '--input', required=True, dest='input',
+                        help='The ipmi sensor yaml config')
+    parser.add_argument('-o', '--output', required=True, dest='output',
+                        help='The output yaml file')
+    parser.add_argument('-m', '--map', dest='map', default='sensor_map.yaml',
+                        help='The sample map yaml file')
+    parser.add_argument('-r', '--rpt', dest='rpt',
+                        help='The .rpt file generated by op-build')
+    parser.add_argument('-f', '--fix', action='store_true',
+                        help='Fix entities and sensorNamePattern')
+
+    # -g expects output as yaml for mapping of entityID/sensorNamePattern
+    # -d expects output as json config for dcmi sensors
+    # Do not mess the output by enforcing only one argument is passed
+    # TODO: -f and -r could be used together, and they are conflicted with -g or -d
+    group = parser.add_mutually_exclusive_group()
+    group.add_argument('-g', '--generate', action='store_true',
+                       help='Generate maps for entityID and sensorNamePattern')
+    group.add_argument('-d', '--dcmi', action='store_true',
+                       help='Generate dcmi sensors json config')
+
+    args = parser.parse_args()
+    args = vars(args)
+
+    if args['input'] is None or args['output'] is None:
+        parser.print_help()
+        exit(1)
+
+    y = openYaml(args['input'])
+
+    if args['fix']:
+        # Fix entities and sensorNamePattern
+        m = openYaml(args['map'])
+
+        for i in y:
+            path = y[i]['path']
+            intfs = tuple(sorted(list(y[i]['interfaces'].keys())))
+            entityId, namePattern = getEntityIdAndNamePattern(path, intfs, m)
+            y[i]['entityID'] = entityId
+            y[i]['entityInstance'] = getEntityInstance(entityId)
+            y[i]['sensorNamePattern'] = namePattern
+            print(y[i]['path'], "id:", entityId,
+                  "instance:", y[i]['entityInstance'])
+
+    sensorIds = list(y.keys())
+    if args['rpt']:
+        unhandledSensors = []
+        rptSensors = loadRpt(args['rpt'])
+        for s in rptSensors:
+            if s.sensorId is not None and s.sensorId not in sensorIds:
+                print("Sensor ID", s.sensorId, "not in yaml:",
+                      s.name, ", path:", s.targetPath)
+                isAdded = False
+                if 'temp' in s.name.lower():
+                    if 'dimm' in s.targetPath.lower():
+                        y[s.sensorId] = getDimmTempConfig(s)
+                        isAdded = True
+                    elif 'core' in s.targetPath.lower():
+                        y[s.sensorId] = getCoreTempConfig(s)
+                        isAdded = True
+                    elif 'centaur' in s.name.lower() or 'membuf' in s.name.lower():
+                        y[s.sensorId] = getMembufTempConfig(s)
+                        isAdded = True
+                elif s.name.lower().endswith('_power'):
+                    y[s.sensorId] = getPowerConfig(s)
+                    isAdded = True
+
+                if isAdded:
+                    print('Added sensor id:', s.sensorId,
+                          ', path:', y[s.sensorId]['path'])
+                else:
+                    unhandledSensors.append(s)
+
+        print('Unhandled sensors:')
+        for s in unhandledSensors:
+            print(s)
+
+    if args['generate']:
+        m = {}
+        for i in y:
+            path = y[i]['path']
+            intfs = tuple(sorted(list(y[i]['interfaces'].keys())))
+            entityId = y[i]['entityID']
+            sensorNamePattern = y[i]['sensorNamePattern']
+            m[(path, intfs)] = {'entityID': entityId,
+                                'sensorNamePattern': sensorNamePattern}
+        y = m
+
+    if args['dcmi']:
+        d = []
+        for i in y:
+            if isCoreTemp(y[i]['path']):
+                s = getDcmiSensor(i, y[i])
+                d.append(s)
+                print(s)
+        saveJson(d, args['output'])
+        return
+
+    safe = False if args['generate'] else True
+    saveYaml(y, args['output'], safe)
+
+
+if __name__ == "__main__":
+    main()