Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Fix pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zenhack committed Feb 7, 2018
1 parent c5d07d0 commit 0ca8b64
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hil/commands/migrate_ipmi_info.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""Helper commands for moving IPMI info from the database to obmd.
This is part of our obmd migration strategy; see the discussion at:
"""

import sys
import json

Expand All @@ -26,6 +25,11 @@ class MigrateIpmiInfo(Command):
help='Admin token for obmd'),
)

# the correct arguments to this are a function of the available options;
# it's normal for subclasses to have implementations with different
# arguments.
#
# pylint: disable=arguments-differ
def run(self, obmd_base_url, obmd_admin_token):
server.init()
with app.app_context():
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/migrate_ipmi_info.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Tests for the `hil-admin migrate-ipmi-info` command."""

from subprocess import check_call, Popen
import shutil
import tempfile
Expand All @@ -17,6 +19,7 @@

@pytest.fixture()
def tmpdir():
"""Create a temporary directory to store various files."""
path = tempfile.mkdtemp()
cwd = os.getcwd()
os.chdir(path)
Expand All @@ -27,6 +30,12 @@ def tmpdir():

@pytest.fixture()
def configure(tmpdir):
"""Set up HIL configuration.
This creates a hil.cfg in tmpdir, and loads it. The file needs to be
written out separately , since we invoke other commands that read it,
besides the test process.
"""
cfg = '\n'.join([
"[extensions]",
"hil.ext.network_allocators.null =",
Expand All @@ -51,6 +60,7 @@ def configure(tmpdir):

@pytest.fixture()
def run_obmd(tmpdir):
"""Set up and start obmd."""
check_call(['go', 'get', 'github.com/CCI-MOC/obmd'])

config_file_path = tmpdir + '/obmd-config.json'
Expand All @@ -75,6 +85,11 @@ def run_obmd(tmpdir):


def test_obmd_migrate(tmpdir):
"""The test proper.
Create some nodes, run the script, and verify that it has done the right
thing.
"""
from hil.ext.obm.ipmi import Ipmi

# Add some objects to the hil database:
Expand Down

0 comments on commit 0ca8b64

Please sign in to comment.