-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #595 from grycap/devel
Devel
- Loading branch information
Showing
5 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Dockerfile to create a container with the IM service | ||
FROM ubuntu:16.04 | ||
FROM ubuntu:18.04 | ||
LABEL maintainer="Miguel Caballer <[email protected]>" | ||
LABEL version="1.7.0" | ||
LABEL description="Container image to run the IM service. (http://www.grycap.upv.es/im)" | ||
|
@@ -15,7 +15,7 @@ RUN pip install pyOpenSSL --upgrade -I | |
RUN pip install msrest msrestazure azure-common azure-mgmt-storage azure-mgmt-compute azure-mgmt-network azure-mgmt-resource azure-mgmt-dns cheroot xmltodict | ||
|
||
# Install IM | ||
RUN apt-get update && apt-get install --no-install-recommends -y gcc libmysqld-dev libssl-dev libffi-dev libsqlite3-dev && \ | ||
RUN apt-get update && apt-get install --no-install-recommends -y gcc libmysqld-dev libssl-dev libffi-dev libsqlite3-dev libmysqlclient20 && \ | ||
pip install pycrypto && \ | ||
pip install MySQL-python && \ | ||
pip install IM==1.7.0 && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# IM - Infrastructure Manager | ||
# Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import sys | ||
|
||
sys.path.append("..") | ||
sys.path.append(".") | ||
|
||
from IM.config import Config | ||
from IM.db import DataBase | ||
|
||
|
||
if __name__ == "__main__": | ||
if not Config.DATA_DB: | ||
sys.stderr.write("No DATA_DB defined in the im.cfg file!!") | ||
sys.exit(-1) | ||
|
||
db = DataBase(Config.DATA_DB) | ||
if db.connect(): | ||
if db.table_exists("inf_list"): | ||
if db.db_type == DataBase.MYSQL: | ||
sys.stdout.write("Updating DB: %s.\n" % Config.DATA_DB) | ||
db.execute("ALTER TABLE `inf_list` ADD COLUMN `rowid` INT AUTO_INCREMENT UNIQUE FIRST;") | ||
else: | ||
sys.stdout.write("SQLite DB does not need to be updated.") | ||
db.close() | ||
else: | ||
sys.stdout.write("There are no inf_list table. Do not need to update.") | ||
else: | ||
sys.stderr.write("Error connecting with DB: %s\n" % Config.DATA_DB) | ||
sys.exit(-1) | ||
|
||
sys.exit(0) |