~smoser/cloud-init/snappy-fix-config

« back to all changes in this revision

Viewing changes to cloudinit/config/cc_snappy.py

  • Committer: Scott Moser
  • Date: 2015-03-27 21:17:16 UTC
  • Revision ID: smoser@ubuntu.com-20150327211716-kumsrk1a9v4xtc08
initial stab at installing from urls

still to do here would be to ake render_snap realize http:
and then to download that.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
    ops += get_fs_package_ops(fspath)
122
122
 
123
123
    for name in packages:
124
 
        ops.append(makeop('install', name, get_package_config(configs, name)))
 
124
        if name.startswith("http://") or name.startswith("https://"):
 
125
            url = name
 
126
            bname = url.rpartition("/")[0]
 
127
            (name, shortname, fname_noext) = parse_filename(bname)
 
128
            ops.append(makeop('install', name, path=url,
 
129
                              config=get_package_config(configs, name)))
 
130
 
 
131
        else:
 
132
            ops.append(makeop('install', name,
 
133
                              get_package_config(configs, name)))
125
134
 
126
135
    to_install = [f['name'] for f in ops]
127
136
    short_to_install = [f['name'].partition(NAMESPACE_DELIM)[0] for f in ops]