<commit_before>require 'stacks/namespace'
require 'stacks/machine_def'

class Stacks::DebRepo < Stacks::MachineDef

  def initialize(virtual_service, index)
    @virtual_service = virtual_service
    super(virtual_service.name + "-" + index)
  end

  def to_enc
    {
      'role::deb_repo' => {}
    }
  end

  def to_specs
    cname = {
      :cnames => {
        :mgmt =>  {
          'aptly-master'     => "#{qualified_hostname(:mgmt)}",
          'deb-transitional' => "#{qualified_hostname(:mgmt)}"
        }
      }
    }
    specs = super.shift
    specs.merge!(cname)
    [specs]
  end
end
<commit_msg>rpearce: Convert deb_repo from to_specs to to_spec<commit_after>require 'stacks/namespace'
require 'stacks/machine_def'

class Stacks::DebRepo < Stacks::MachineDef

  def initialize(virtual_service, index)
    @virtual_service = virtual_service
    super(virtual_service.name + "-" + index)
  end

  def to_enc
    {
      'role::deb_repo' => {}
    }
  end

  def to_spec
    specs = super
    cname = {
      :cnames => {
        :mgmt =>  {
          'aptly-master'     => "#{qualified_hostname(:mgmt)}",
          'deb-transitional' => "#{qualified_hostname(:mgmt)}"
        }
      }
    }
    specs.merge!(cname)
    specs
  end
end

{'fraction_non_alphanumeric': 0.1344, 'fraction_numerical': 0.0, 'mean_word_length': 2.5338983050847457, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7354087', 'n_tokens_mistral': 449, 'n_tokens_neox': 438, 'n_words': 74}