Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
Fix unstable package repository and network configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
rybaktomasz committed Jan 12, 2014
1 parent 4b9d801 commit 3bc47f6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
5 changes: 3 additions & 2 deletions common/tasks/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class AddDefaultSources(Task):
def run(cls, info):
info.source_lists.add('main', 'deb {apt_mirror} {system.release} main')
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} main')
info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates main')
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates main')
if info.manifest.system['release'] != 'unstable':
info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates main')
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates main')


class InstallTrustedKeys(Task):
Expand Down
13 changes: 13 additions & 0 deletions common/tasks/network-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"squeeze": [
"auto lo\n",
"iface lo inet loopback\n",
"auto eth0\n",
"iface eth0 inet dhcp\n" ],
"wheezy": [
"auto eth0\n",
"iface eth0 inet dhcp\n" ],
"unstable": [
"auto eth0\n",
"iface eth0 inet dhcp\n" ]
}
12 changes: 5 additions & 7 deletions common/tasks/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ class ConfigureNetworkIF(Task):
@classmethod
def run(cls, info):
interfaces_path = os.path.join(info.root, 'etc/network/interfaces')
if_config = {'squeeze': ('auto lo\n'
'iface lo inet loopback\n'
'auto eth0\n'
'iface eth0 inet dhcp\n'),
'wheezy': 'auto eth0\n'
'iface eth0 inet dhcp\n'}
if_config = []
with open('common/tasks/network-configuration.json') as stream:
import json
if_config = json.loads(stream.read())
with open(interfaces_path, 'a') as interfaces:
interfaces.write(if_config.get(info.manifest.system['release']))
interfaces.write(''.join(if_config.get(info.manifest.system['release'])))
4 changes: 2 additions & 2 deletions providers/ec2/tasks/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def run(cls, info):

# In squeeze, we need a special kernel flavor for xen
kernels = {}
with open('packages-kernels.json') as stream:
with open('providers/ec2/tasks/packages-kernels.json') as stream:
import json
kernel = json.loads(stream.read())
kernels = json.loads(stream.read())
kernel_package = kernels.get(info.manifest.system['release']).get(info.manifest.system['architecture'])
info.packages.add(kernel_package)

0 comments on commit 3bc47f6

Please sign in to comment.