diff options
Diffstat (limited to 'tools/devassistant/assistants/crt/python/openlmi.yaml')
-rw-r--r-- | tools/devassistant/assistants/crt/python/openlmi.yaml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/tools/devassistant/assistants/crt/python/openlmi.yaml b/tools/devassistant/assistants/crt/python/openlmi.yaml new file mode 100644 index 0000000..1a736aa --- /dev/null +++ b/tools/devassistant/assistants/crt/python/openlmi.yaml @@ -0,0 +1,77 @@ +openlmi: + fullname: Python OpenLMI provider + description: 'Python OpenLMI assistant will help you create an OpenLMI provider and install necessary dependencies.' + + dependencies: + - use: super.dependencies + - rpm: ['pywbem', 'cmpi-bindings-pywbem', 'openlmi-providers'] + + dependencies_eclipse: + - use: eclipse.dependencies_python + + dependencies_vim: + - use: vim.dependencies + + args: + name: + use: common_args + + eclipse: + use: eclipse + + github: + use: common_args + + vim: + use: vim + + files: + gitignore: &gitignore + source: ../.gitignore + sources: &sources + source: . + + run: + - $dirname: $(dirname "$name") + - $basename: $(basename "$name") + - log_i: 'Creating Python OpenLMI provider $basename in $dirname ...' + - if $(test -e "$name"): + - log_e: '$name already exists, cannot proceed.' + - else: + - cl_i: cp -r --dereference *sources "$name" + - cl: cd "$basename" + + # for some reason the \n newlines are often parsed badly (ignored), this doesn't seem to happen with \r newlines + # https://bugzilla.redhat.com/show_bug.cgi?id=1061207 + - for $i in $(find -type f -name '*.tpl' -printf '%p\r'): + - log_i: "Processing file $i..." + - jinja_render: + template: + source: $i + destination: $(pwd) + data: + PROJECT_NAME: $basename + + - cl: for j in `find -name '*{{PROJECT_NAME}}*'`; do mv "$j" "`echo $j | sed 's/{{PROJECT_NAME}}/$basename/'`"; done + - cl: find -name '*.tpl' -delete + + - log_i: 'Building sources ...' + - cl: python setup.py build + - cl_i: cd .. + + - cl: cd "$name" + - dda_c: . + - if defined $vim: + - use: vim.run + - if $eclipse: + - use: eclipse.run_python + - cl: cp *gitignore . + - use: git_init_add_commit + - if defined $github: + - github: create_and_push + - log_i: 'Python OpenLMI provider project $basename in $dirname has been created.' + - log_i: 'Remember it''s just a skeleton that should be filled in order to make the provider' + - log_i: 'usable. Specifically classes in MOF files and corresponding code in the generated' + - log_i: 'skeleton.' + - log_i: '' + - log_i: 'Please have a look at the README file for further instructions.' |