summaryrefslogtreecommitdiffstats
path: root/scripts/channel_gen.py
diff options
context:
space:
mode:
authorJohnathan Mantey <johnathanx.mantey@intel.com>2018-12-13 13:47:21 -0800
committerJohnathan Mantey <johnathanx.mantey@intel.com>2019-02-05 11:36:21 -0800
commit41ac50530ab0618155d9e8ae3be3a0abd59c24e4 (patch)
tree26873c4d987561d808c44652342d11dd4daec187 /scripts/channel_gen.py
parentcb89c0e359f4fd6ce39884a4da6b57b093223829 (diff)
downloadphosphor-host-ipmid-41ac50530ab0618155d9e8ae3be3a0abd59c24e4.tar.gz
phosphor-host-ipmid-41ac50530ab0618155d9e8ae3be3a0abd59c24e4.zip
Removing net.hpp and net.cpp because functionality moved
The functionality provided by net.hpp and net.cpp has been moved into the channel_mgmt class. Change-Id: I4820609f87f27ebe81d9b36f7b8e95a5262985ac Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
Diffstat (limited to 'scripts/channel_gen.py')
-rwxr-xr-xscripts/channel_gen.py60
1 files changed, 0 insertions, 60 deletions
diff --git a/scripts/channel_gen.py b/scripts/channel_gen.py
deleted file mode 100755
index 77fbd2e..0000000
--- a/scripts/channel_gen.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import sys
-import yaml
-import argparse
-from mako.template import Template
-
-
-def generate_cpp(interface_yaml, output_dir):
- with open(os.path.join(script_dir, interface_yaml), 'r') as f:
- ifile = yaml.safe_load(f)
- if not isinstance(ifile, dict):
- ifile = {}
-
- # Render the mako template
-
- t = Template(filename=os.path.join(
- script_dir,
- "writechannel.mako.cpp"))
-
- output_cpp = os.path.join(output_dir, "channel-gen.cpp")
- with open(output_cpp, 'w') as fd:
- fd.write(t.render(interfaceDict=ifile))
-
-
-def main():
-
- valid_commands = {
- 'generate-cpp': generate_cpp
- }
- parser = argparse.ArgumentParser(
- description="IPMI ethernet interface parser and code generator")
-
- parser.add_argument(
- '-i', '--interface_yaml', dest='interface_yaml',
- default='example.yaml', help='input sensor yaml file to parse')
-
- parser.add_argument(
- "-o", "--output-dir", dest="outputdir",
- default=".",
- help="output directory")
-
- parser.add_argument(
- 'command', metavar='COMMAND', type=str,
- choices=valid_commands.keys(),
- help='Command to run.')
-
- args = parser.parse_args()
-
- if (not (os.path.isfile(os.path.join(script_dir, args.interface_yaml)))):
- sys.exit("Can not find input yaml file " + args.interface_yaml)
-
- function = valid_commands[args.command]
- function(args.interface_yaml, args.outputdir)
-
-
-if __name__ == '__main__':
- script_dir = os.path.dirname(os.path.realpath(__file__))
- main()
OpenPOWER on IntegriCloud