Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`write': wrong argument type Hash (expected String) (TypeError) #2

Open
lelutin opened this issue Apr 1, 2017 · 3 comments
Open

`write': wrong argument type Hash (expected String) (TypeError) #2

lelutin opened this issue Apr 1, 2017 · 3 comments

Comments

@lelutin
Copy link

lelutin commented Apr 1, 2017

Hello,

I'm trying out a simple config that has only one ssh host:

switches:
  repo_path: "/home/vagrant/switches"                       #the path to the repo (absolute path recommended)
  git_author:                                 #the author to specify for git commits and annotated tags
    email: "something@example.com"
    name: "something"
  revfmt: 'r%d'                               #sprintf format to use for tags - this example produces SVN style tags
  defuser: 'someuser'                             #default username for SSH if none is specified for a particular host
  defdirkey: 'hostname'                       #default YAML key to use for each host's config dir
  ssh_keys:                                   #array of SSH keys to attempt authentication with (must be OpenSSH format)
    - '/home/vagrant/.ssh/id_rsa'            #POSIX style

  hosts:                                      #array of hosts we want to fetch data for
    -
      hostname: '10.10.10.200'
      dir: 'someswitch'
      ssh:
        running-config:
          cmd: 'sh run'
        crypto-authentication:
          cmd: 'sh authen'

I'm running this against an HP switch that has public-key auth setup for the manager access.

I get this error:

vagrant@jessie:~/Project-Illuminati$ bundle exec ruby nwo.rb -f p2.yml -n switches
10.10.10.200 - premature channel close
/home/vagrant/Project-Illuminati/lib/rugged-illuminati/commit.rb:74:in `write': wrong argument type Hash (expected String) (TypeError)
	from /home/vagrant/Project-Illuminati/lib/rugged-illuminati/commit.rb:74:in `add_blob'
	from /home/vagrant/Project-Illuminati/lib/rugged-illuminati/commit.rb:80:in `block (2 levels) in add_files'

I've tried with a newly initialized git repos, no repos and a repository with an initial commit with a dummy file. I walways get the same error.

@lelutin
Copy link
Author

lelutin commented Apr 1, 2017

if I change the ssh section of the host to look like this:

        running-config: 'sh run'
        crypto-authentication: 'sh authen'

then I don't get the error anymore but I'm still getting a "premature channel close" without any explanation. I'm wondering if that's because the switch expects the user to press enter before typing any command.

edit: sorry, was missing the config snippet

@Olipro
Copy link
Owner

Olipro commented Jun 21, 2017

Hi, sorry for the super-late response, are you still having this issue? did you figure it out or give up?

@lelutin
Copy link
Author

lelutin commented Jun 21, 2017

hi there!

I actually gave up. I was having too many issues with project illuminati, and I ended up realising that RANCID actually now supports git-backed storage, which was what I was looking for combined with router/switch config fetching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants