]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
add a remote helper to pin repos 243/head
authorAlfredo Deza <alfredo.deza@inktank.com>
Fri, 26 Sep 2014 14:18:13 +0000 (10:18 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Fri, 26 Sep 2014 14:18:13 +0000 (10:18 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/hosts/remotes.py

index 26c41004364c8774b4f36c62475ac9490968dfe0..c000c2f236db98e15b3d6e517a092f7117675c0f 100644 (file)
@@ -57,6 +57,13 @@ def write_yum_repo(content, filename='ceph.repo'):
     write_file(repo_path, content)
 
 
+def set_apt_priority(fqdn, path='/etc/apt/preferences.d/ceph.pref'):
+    template = "Package: *\nPin: origin {fqdn}\nPin-Priority: 999\n"
+    content = template.format(fqdn=fqdn)
+    with open(path, 'wb') as fout:
+        fout.write(content)
+
+
 def set_repo_priority(sections, path='/etc/yum.repos.d/ceph.repo', priority='1'):
     Config = ConfigParser.ConfigParser()
     Config.read(path)