~raharper/curtin/new-bionic-upstream-snapshot-v2

« back to all changes in this revision

Viewing changes to curtin/commands/block_meta.py

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2014-03-26 17:34:57 UTC
  • mto: (27.1.1 wily) (58.1.1 pkg)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20140326173457-mr46h4jvuju8q775
Tags: upstream-0.1.0~bzr121
ImportĀ upstreamĀ versionĀ 0.1.0~bzr121

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#   You should have received a copy of the GNU Affero General Public License
16
16
#   along with Curtin.  If not, see <http://www.gnu.org/licenses/>.
17
17
 
 
18
from collections import OrderedDict
18
19
from curtin import block
19
20
from curtin import util
20
21
from curtin.log import LOG
46
47
 
47
48
 
48
49
def meta_simple(args):
 
50
    state = util.load_command_environment()
 
51
 
 
52
    cfg = util.load_command_config(args, state)
 
53
 
49
54
    devices = args.devices
50
55
    if devices is None:
 
56
        devices = cfg.get('block-meta', {}).get('devices', [])
 
57
 
 
58
    # Remove duplicates but maintain ordering.
 
59
    devices = list(OrderedDict.fromkeys(devices))
 
60
 
 
61
    if len(devices) == 0:
51
62
        devices = block.get_installable_blockdevs()
52
63
        LOG.warn("simple mode, no devices given. unused list: %s", devices)
53
64
 
69
80
    (devname, devnode) = block.get_dev_name_entry(target)
70
81
 
71
82
    LOG.info("installing in simple mode to '%s'", devname)
72
 
    state = util.load_command_environment()
73
83
 
74
84
    # helper partition will forcibly set up partition there
75
85
    logtime("partition %s" % devnode, util.subp, ("partition", devnode))