Skip to content

Commit 5733229

Browse files
authored
Fixing Jenkins error (#48)
- ompackagemanager generate-cache can be used without OMPython
1 parent 7f74fe2 commit 5733229

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

ompackagemanager/updateinfo.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import OMPython
21
import os
32
from github import Github
43
from atlassian import Bitbucket
@@ -8,8 +7,16 @@
87
import re
98
import shutil
109
import requests
10+
import warnings
1111
import zipfile
1212

13+
try:
14+
import OMPython
15+
except ImportError:
16+
OMPython = None
17+
warnings.warn("Failed to load module OMPython.")
18+
19+
1320
from ompackagemanager import common
1421

1522
bitbucket = Bitbucket(url="https://api.bitbucket.org")
@@ -64,6 +71,9 @@ def main():
6471
gh_auth = os.environ["GITHUB_AUTH"]
6572
g = Github(gh_auth)
6673

74+
if OMPython is None:
75+
raise Exception("Module OMPython missing, aborting!")
76+
6777
omc = OMPython.OMCSessionZMQ()
6878

6979
data = json.load(open("repos.json"))

0 commit comments

Comments
 (0)