
from kolla.image import build


def main():
    statuses = build.run_build()
    if statuses:
        bad_results, good_results, unmatched_results = statuses
        if bad_results:
            return 1
    return 0


if __name__ == '__main__':
    main()


import os
import sys

PROJECT_ROOT = os.path.abspath(os.path.join(
    os.path.dirname(os.path.realpath(__file__)), '../..'))
if PROJECT_ROOT not in sys.path:
    sys.path.insert(0, PROJECT_ROOT)

from kolla.image import build


def main():
    statuses = build.run_build()
    if statuses:
        bad_results, good_results, unmatched_results = statuses
        if bad_results:
            return 1
    return 0


if __name__ == '__main__':
    main()

Change the search path to look locally
Change the search path to look locally

In order to use tools/build.py, we need to search
locally for imports.

Closes-bug: #1592030
Change-Id: Idfa651c1268f93366de9f4e3fa80c33be42c71c3

+ 
+ import os
+ import sys
+ 
+ PROJECT_ROOT = os.path.abspath(os.path.join(
+     os.path.dirname(os.path.realpath(__file__)), '../..'))
+ if PROJECT_ROOT not in sys.path:
+     sys.path.insert(0, PROJECT_ROOT)
  
  from kolla.image import build
  
  
  def main():
      statuses = build.run_build()
      if statuses:
          bad_results, good_results, unmatched_results = statuses
          if bad_results:
              return 1
      return 0
  
  
  if __name__ == '__main__':
      main()
  
Change the search path to look locally
## Code Before:

from kolla.image import build


def main():
    statuses = build.run_build()
    if statuses:
        bad_results, good_results, unmatched_results = statuses
        if bad_results:
            return 1
    return 0


if __name__ == '__main__':
    main()

## Instruction:
Change the search path to look locally
## Code After:

import os
import sys

PROJECT_ROOT = os.path.abspath(os.path.join(
    os.path.dirname(os.path.realpath(__file__)), '../..'))
if PROJECT_ROOT not in sys.path:
    sys.path.insert(0, PROJECT_ROOT)

from kolla.image import build


def main():
    statuses = build.run_build()
    if statuses:
        bad_results, good_results, unmatched_results = statuses
        if bad_results:
            return 1
    return 0


if __name__ == '__main__':
    main()
