~canonical-platform-qa/snappy-ecosystem-tests/fixing_ci

« back to all changes in this revision

Viewing changes to snappy_ecosystem_tests/snapcraft/snapcraft.py

  • Committer: Heber Parrucci
  • Date: 2017-02-15 19:14:19 UTC
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: heber.parrucci@canonical.com-20170215191419-a3549ap02gflc8rj
Addressing review feedback regarding credentials:
Now it is read from a user config file that is outside the repo in the host machine. If that config is not found, then it reads the credentials from env variables.
The idea is to store the config with the credentials in a private repository, and then Jenkins will get it and store in the host machine when running the tests.
The same mechanism is used in ubuntu-system-tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
 
32
32
class Snapcraft(object):
33
 
    """Contain Snapcraft specific functionality to use via command line interface"""
 
33
    """Contain Snapcraft specific functionality to use via command
 
34
    line interface"""
34
35
    def __init__(self):
35
36
        """Create new snapcraft instance."""
36
37
        self._login = False
65
66
        self._login = True
66
67
 
67
68
    def list_registered(self):
68
 
        """call snapcraft list-registered command, raise exception if not logged in"""
 
69
        """call snapcraft list-registered command,
 
70
        raise exception if not logged in"""
69
71
        if self._login is False:
70
 
            raise ValueError("User is not logged in, please login before using this command")
 
72
            raise ValueError("User is not logged in, "
 
73
                             "please login before using this command")
71
74
        return pexpect.spawnu("snapcraft list-registered").read()