Skip to content
Snippets Groups Projects
Commit 826dfa8d authored by Marko Mecina's avatar Marko Mecina
Browse files

add help message to MIB import script

parent f61e2586
No related branches found
No related tags found
No related merge requests found
...@@ -97,14 +97,18 @@ def import_mib(): ...@@ -97,14 +97,18 @@ def import_mib():
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) > 1: if '-c' in sys.argv:
MIBDIR = '/home/user/space/mib' # directory containing the SCOS2000 *.dat files
DBNAME = 'mib_schema_test' # SQL schema name to be created
DBURL = 'mysql://user:password@127.0.0.1' # credentials of MySQL account
elif len(sys.argv) > 1:
MIBDIR, DBNAME, dbuser = sys.argv[1:4] MIBDIR, DBNAME, dbuser = sys.argv[1:4]
dbpw = getpass.getpass() dbpw = getpass.getpass()
DBURL = 'mysql://{}:{}@127.0.0.1'.format(dbuser, dbpw) DBURL = 'mysql://{}:{}@127.0.0.1'.format(dbuser, dbpw)
else: else:
MIBDIR = '/home/user/space/mib' # directory containing the SCOS2000 *.dat files print('USAGE: ./import_mib.py <MIBDIR> <DBSCHEMA> <DBUSERNAME> [-c]\n'
DBNAME = 'mib_schema_test' # SQL schema name to be created 'Options:\n\t-c\tUse configuration in script, any command line arguments will be ignored')
DBURL = 'mysql://user:password@127.0.0.1' # credentials of MySQL account sys.exit()
generate_wbsql() generate_wbsql()
create_schema() create_schema()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment