summaryrefslogtreecommitdiffstats
path: root/tools/devassistant/assistants/crt/python/openlmi.yaml
blob: 1a736aa53d8c2c0916f16ed1e28b2fffc8e64ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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.'