├── .gitignore ├── .gitreview ├── API.md ├── CODE_OF_CONDUCT.md ├── HINTS.md ├── LICENSE.txt ├── Makefile ├── README.md ├── Vagrantfile ├── ansible.cfg ├── ansible ├── fakeswitch.yml ├── group_vars │ └── all ├── headnode.yml ├── maasdev.yml └── roles │ ├── common │ ├── defaults │ │ └── main.yml │ ├── files │ │ └── ssh-config │ └── tasks │ │ └── main.yml │ ├── consul-template │ ├── files │ │ ├── consul-template │ │ ├── example.conf.tmpl │ │ ├── example.ctmpl │ │ └── example.toml │ └── tasks │ │ └── main.yml │ ├── docker-compose │ └── tasks │ │ └── main.yml │ ├── docker │ ├── defaults │ │ └── main.yml │ ├── files │ │ ├── docker.centos.repo │ │ ├── docker.centos.service │ │ └── docker_apt_key.gpg │ ├── tasks │ │ ├── centos.yml │ │ ├── debian.yml │ │ └── main.yml │ └── templates │ │ ├── docker-swarm-master.service │ │ ├── docker-swarm-node.service │ │ └── docker.cfg │ ├── fakeswitch │ ├── files │ │ ├── persist │ │ └── savepersist │ └── tasks │ │ └── main.yml │ ├── java8-oracle │ └── tasks │ │ └── main.yml │ └── registry │ ├── files │ └── mirror-config.yml │ └── tasks │ └── main.yml ├── automation ├── Dockerfile.automation ├── LICENSE ├── Makefile ├── README.md ├── lifecycle.png ├── maas-flow.go ├── mappings.json ├── node.go ├── provisioner_api.go ├── sample-filter.json ├── state.go └── vendor │ ├── github.com │ ├── Sirupsen │ │ └── logrus │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── alt_exit.go │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_appengine.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_solaris.go │ │ │ ├── terminal_windows.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── juju │ │ ├── ansiterm │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── attribute.go │ │ │ ├── color.go │ │ │ ├── context.go │ │ │ ├── doc.go │ │ │ ├── style.go │ │ │ ├── tabwriter.go │ │ │ ├── tabwriter │ │ │ │ └── tabwriter.go │ │ │ ├── terminal.go │ │ │ └── writer.go │ │ ├── errors │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── errortypes.go │ │ │ ├── functions.go │ │ │ └── path.go │ │ ├── gomaasapi │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.rst │ │ │ ├── blockdevice.go │ │ │ ├── bootresource.go │ │ │ ├── client.go │ │ │ ├── controller.go │ │ │ ├── dependencies.tsv │ │ │ ├── device.go │ │ │ ├── enum.go │ │ │ ├── errors.go │ │ │ ├── fabric.go │ │ │ ├── file.go │ │ │ ├── filesystem.go │ │ │ ├── gomaasapi.go │ │ │ ├── interface.go │ │ │ ├── interfaces.go │ │ │ ├── jsonobject.go │ │ │ ├── link.go │ │ │ ├── maas.go │ │ │ ├── maasobject.go │ │ │ ├── machine.go │ │ │ ├── oauth.go │ │ │ ├── partition.go │ │ │ ├── space.go │ │ │ ├── subnet.go │ │ │ ├── testing.go │ │ │ ├── testservice.go │ │ │ ├── testservice_spaces.go │ │ │ ├── testservice_subnets.go │ │ │ ├── testservice_utils.go │ │ │ ├── testservice_vlan.go │ │ │ ├── urlparams.go │ │ │ ├── util.go │ │ │ ├── vlan.go │ │ │ └── zone.go │ │ ├── loggo │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── config.go │ │ │ ├── context.go │ │ │ ├── dependencies.tsv │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── formatter.go │ │ │ ├── global.go │ │ │ ├── level.go │ │ │ ├── logger.go │ │ │ ├── module.go │ │ │ ├── testwriter.go │ │ │ └── writer.go │ │ ├── schema │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── checker.go │ │ │ ├── const.go │ │ │ ├── errors.go │ │ │ ├── fieldmap.go │ │ │ ├── lists.go │ │ │ ├── maps.go │ │ │ ├── numeric.go │ │ │ ├── size.go │ │ │ ├── strings.go │ │ │ ├── time.go │ │ │ └── time_duration.go │ │ ├── utils │ │ │ ├── LICENSE │ │ │ ├── LICENSE.golang │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── attempt.go │ │ │ ├── clock │ │ │ │ ├── clock.go │ │ │ │ └── wall.go │ │ │ ├── command.go │ │ │ ├── dependencies.tsv │ │ │ ├── file.go │ │ │ ├── file_unix.go │ │ │ ├── file_windows.go │ │ │ ├── gomaxprocs.go │ │ │ ├── home_unix.go │ │ │ ├── home_windows.go │ │ │ ├── http-1_4.go │ │ │ ├── http-1_7.go │ │ │ ├── http.go │ │ │ ├── isubuntu.go │ │ │ ├── limiter.go │ │ │ ├── multireader.go │ │ │ ├── naturalsort.go │ │ │ ├── network.go │ │ │ ├── os.go │ │ │ ├── password.go │ │ │ ├── randomstring.go │ │ │ ├── relativeurl.go │ │ │ ├── set │ │ │ │ ├── ints.go │ │ │ │ ├── strings.go │ │ │ │ └── tags.go │ │ │ ├── size.go │ │ │ ├── systemerrmessages_unix.go │ │ │ ├── systemerrmessages_windows.go │ │ │ ├── timeit.go │ │ │ ├── timer.go │ │ │ ├── tls.go │ │ │ ├── trivial.go │ │ │ ├── username.go │ │ │ ├── uuid.go │ │ │ ├── yaml.go │ │ │ └── zfile_windows.go │ │ └── version │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── version.go │ ├── kelseyhightower │ │ └── envconfig │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── env_os.go │ │ │ ├── env_syscall.go │ │ │ ├── envconfig.go │ │ │ └── usage.go │ ├── lunixbochs │ │ └── vtclean │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── io.go │ │ │ ├── line.go │ │ │ ├── regex.txt │ │ │ └── vtclean.go │ └── mattn │ │ ├── go-colorable │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ └── noncolorable.go │ │ └── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── isatty_appengine.go │ │ ├── isatty_bsd.go │ │ ├── isatty_linux.go │ │ ├── isatty_solaris.go │ │ └── isatty_windows.go │ ├── golang.org │ └── x │ │ └── crypto │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── pbkdf2 │ │ └── pbkdf2.go │ ├── gopkg.in │ ├── juju │ │ └── names.v2 │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── action.go │ │ │ ├── application.go │ │ │ ├── charm.go │ │ │ ├── cloud.go │ │ │ ├── cloudcredential.go │ │ │ ├── controller.go │ │ │ ├── environ.go │ │ │ ├── filesystem.go │ │ │ ├── ipaddress.go │ │ │ ├── machine.go │ │ │ ├── model.go │ │ │ ├── payload.go │ │ │ ├── relation.go │ │ │ ├── space.go │ │ │ ├── storage.go │ │ │ ├── subnet.go │ │ │ ├── tag.go │ │ │ ├── unit.go │ │ │ ├── user.go │ │ │ └── volume.go │ ├── mgo.v2 │ │ ├── LICENSE │ │ ├── bson │ │ │ ├── LICENSE │ │ │ ├── bson.go │ │ │ ├── decimal.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ └── json.go │ │ └── internal │ │ │ └── json │ │ │ ├── LICENSE │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── extension.go │ │ │ ├── fold.go │ │ │ ├── indent.go │ │ │ ├── scanner.go │ │ │ ├── stream.go │ │ │ └── tags.go │ └── yaml.v2 │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go │ └── vendor.json ├── compute-node.yml ├── compute.yml ├── config-generator ├── Dockerfile.generator ├── Makefile ├── README.md ├── configGen.go ├── handlers.go ├── netconfig.tpl ├── network-cfg.json ├── onos_types.go └── vendor │ ├── github.com │ ├── Sirupsen │ │ └── logrus │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── alt_exit.go │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_appengine.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_solaris.go │ │ │ ├── terminal_windows.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── gorilla │ │ └── mux │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── context_gorilla.go │ │ │ ├── context_native.go │ │ │ ├── doc.go │ │ │ ├── mux.go │ │ │ ├── regexp.go │ │ │ └── route.go │ └── kelseyhightower │ │ └── envconfig │ │ ├── LICENSE │ │ ├── MAINTAINERS │ │ ├── README.md │ │ ├── doc.go │ │ ├── env_os.go │ │ ├── env_syscall.go │ │ ├── envconfig.go │ │ └── usage.go │ └── vendor.json ├── deploy-vars ├── dev-head-node.yml ├── doc └── images │ ├── physical.graffle │ ├── physical.png │ ├── uservices.graffle │ └── uservices.png ├── fabric.yml ├── group_vars └── all ├── harvester ├── Dockerfile.harvester ├── Makefile ├── README.md ├── handlers.go ├── harvester.go ├── lease.go ├── parse.go ├── vendor │ ├── github.com │ │ ├── Sirupsen │ │ │ └── logrus │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── alt_exit.go │ │ │ │ ├── doc.go │ │ │ │ ├── entry.go │ │ │ │ ├── exported.go │ │ │ │ ├── formatter.go │ │ │ │ ├── hooks.go │ │ │ │ ├── json_formatter.go │ │ │ │ ├── logger.go │ │ │ │ ├── logrus.go │ │ │ │ ├── terminal_appengine.go │ │ │ │ ├── terminal_bsd.go │ │ │ │ ├── terminal_linux.go │ │ │ │ ├── terminal_notwindows.go │ │ │ │ ├── terminal_solaris.go │ │ │ │ ├── terminal_windows.go │ │ │ │ ├── text_formatter.go │ │ │ │ └── writer.go │ │ ├── gorilla │ │ │ └── mux │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── context_gorilla.go │ │ │ │ ├── context_native.go │ │ │ │ ├── doc.go │ │ │ │ ├── mux.go │ │ │ │ ├── regexp.go │ │ │ │ └── route.go │ │ ├── kelseyhightower │ │ │ └── envconfig │ │ │ │ ├── LICENSE │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ ├── env_os.go │ │ │ │ ├── env_syscall.go │ │ │ │ ├── envconfig.go │ │ │ │ └── usage.go │ │ └── tatsushid │ │ │ └── go-fastping │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── fastping.go │ ├── golang.org │ │ └── x │ │ │ └── net │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ ├── bpf │ │ │ ├── asm.go │ │ │ ├── constants.go │ │ │ ├── doc.go │ │ │ ├── instructions.go │ │ │ ├── vm.go │ │ │ └── vm_instructions.go │ │ │ ├── icmp │ │ │ ├── dstunreach.go │ │ │ ├── echo.go │ │ │ ├── endpoint.go │ │ │ ├── extension.go │ │ │ ├── helper.go │ │ │ ├── helper_posix.go │ │ │ ├── interface.go │ │ │ ├── ipv4.go │ │ │ ├── ipv6.go │ │ │ ├── listen_posix.go │ │ │ ├── listen_stub.go │ │ │ ├── message.go │ │ │ ├── messagebody.go │ │ │ ├── mpls.go │ │ │ ├── multipart.go │ │ │ ├── packettoobig.go │ │ │ ├── paramprob.go │ │ │ ├── sys_freebsd.go │ │ │ └── timeexceeded.go │ │ │ ├── internal │ │ │ ├── iana │ │ │ │ ├── const.go │ │ │ │ └── gen.go │ │ │ └── netreflect │ │ │ │ ├── socket.go │ │ │ │ ├── socket_posix.go │ │ │ │ └── socket_stub.go │ │ │ ├── ipv4 │ │ │ ├── bpfopt_linux.go │ │ │ ├── bpfopt_stub.go │ │ │ ├── control.go │ │ │ ├── control_bsd.go │ │ │ ├── control_pktinfo.go │ │ │ ├── control_stub.go │ │ │ ├── control_unix.go │ │ │ ├── control_windows.go │ │ │ ├── defs_darwin.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── defs_freebsd.go │ │ │ ├── defs_linux.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── defs_solaris.go │ │ │ ├── dgramopt_posix.go │ │ │ ├── dgramopt_stub.go │ │ │ ├── doc.go │ │ │ ├── endpoint.go │ │ │ ├── gen.go │ │ │ ├── genericopt_posix.go │ │ │ ├── genericopt_stub.go │ │ │ ├── header.go │ │ │ ├── helper.go │ │ │ ├── iana.go │ │ │ ├── icmp.go │ │ │ ├── icmp_linux.go │ │ │ ├── icmp_stub.go │ │ │ ├── packet.go │ │ │ ├── payload.go │ │ │ ├── payload_cmsg.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── sockopt.go │ │ │ ├── sockopt_asmreq.go │ │ │ ├── sockopt_asmreq_posix.go │ │ │ ├── sockopt_asmreq_stub.go │ │ │ ├── sockopt_asmreqn_stub.go │ │ │ ├── sockopt_asmreqn_unix.go │ │ │ ├── sockopt_posix.go │ │ │ ├── sockopt_ssmreq_stub.go │ │ │ ├── sockopt_ssmreq_unix.go │ │ │ ├── sockopt_stub.go │ │ │ ├── sys_bsd.go │ │ │ ├── sys_darwin.go │ │ │ ├── sys_freebsd.go │ │ │ ├── sys_linux.go │ │ │ ├── sys_linux_386.s │ │ │ ├── sys_openbsd.go │ │ │ ├── sys_solaris.go │ │ │ ├── sys_solaris_amd64.s │ │ │ ├── sys_stub.go │ │ │ ├── sys_windows.go │ │ │ ├── syscall_linux_386.go │ │ │ ├── syscall_solaris.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_windows.go │ │ │ ├── zsys_darwin.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── zsys_freebsd_386.go │ │ │ ├── zsys_freebsd_amd64.go │ │ │ ├── zsys_freebsd_arm.go │ │ │ ├── zsys_linux_386.go │ │ │ ├── zsys_linux_amd64.go │ │ │ ├── zsys_linux_arm.go │ │ │ ├── zsys_linux_arm64.go │ │ │ ├── zsys_linux_mips.go │ │ │ ├── zsys_linux_mips64.go │ │ │ ├── zsys_linux_mips64le.go │ │ │ ├── zsys_linux_mipsle.go │ │ │ ├── zsys_linux_ppc.go │ │ │ ├── zsys_linux_ppc64.go │ │ │ ├── zsys_linux_ppc64le.go │ │ │ ├── zsys_linux_s390x.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── zsys_openbsd.go │ │ │ └── zsys_solaris.go │ │ │ └── ipv6 │ │ │ ├── bpfopt_linux.go │ │ │ ├── bpfopt_stub.go │ │ │ ├── control.go │ │ │ ├── control_rfc2292_unix.go │ │ │ ├── control_rfc3542_unix.go │ │ │ ├── control_stub.go │ │ │ ├── control_unix.go │ │ │ ├── control_windows.go │ │ │ ├── defs_darwin.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── defs_freebsd.go │ │ │ ├── defs_linux.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── defs_solaris.go │ │ │ ├── dgramopt_posix.go │ │ │ ├── dgramopt_stub.go │ │ │ ├── doc.go │ │ │ ├── endpoint.go │ │ │ ├── gen.go │ │ │ ├── genericopt_posix.go │ │ │ ├── genericopt_stub.go │ │ │ ├── header.go │ │ │ ├── helper.go │ │ │ ├── iana.go │ │ │ ├── icmp.go │ │ │ ├── icmp_bsd.go │ │ │ ├── icmp_linux.go │ │ │ ├── icmp_solaris.go │ │ │ ├── icmp_stub.go │ │ │ ├── icmp_windows.go │ │ │ ├── payload.go │ │ │ ├── payload_cmsg.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── sockopt.go │ │ │ ├── sockopt_asmreq_posix.go │ │ │ ├── sockopt_posix.go │ │ │ ├── sockopt_ssmreq_stub.go │ │ │ ├── sockopt_ssmreq_unix.go │ │ │ ├── sockopt_stub.go │ │ │ ├── sys_bsd.go │ │ │ ├── sys_darwin.go │ │ │ ├── sys_freebsd.go │ │ │ ├── sys_linux.go │ │ │ ├── sys_linux_386.s │ │ │ ├── sys_solaris.go │ │ │ ├── sys_solaris_amd64.s │ │ │ ├── sys_stub.go │ │ │ ├── sys_windows.go │ │ │ ├── syscall_linux_386.go │ │ │ ├── syscall_solaris.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_windows.go │ │ │ ├── zsys_darwin.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── zsys_freebsd_386.go │ │ │ ├── zsys_freebsd_amd64.go │ │ │ ├── zsys_freebsd_arm.go │ │ │ ├── zsys_linux_386.go │ │ │ ├── zsys_linux_amd64.go │ │ │ ├── zsys_linux_arm.go │ │ │ ├── zsys_linux_arm64.go │ │ │ ├── zsys_linux_mips.go │ │ │ ├── zsys_linux_mips64.go │ │ │ ├── zsys_linux_mips64le.go │ │ │ ├── zsys_linux_mipsle.go │ │ │ ├── zsys_linux_ppc.go │ │ │ ├── zsys_linux_ppc64.go │ │ │ ├── zsys_linux_ppc64le.go │ │ │ ├── zsys_linux_s390x.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── zsys_openbsd.go │ │ │ └── zsys_solaris.go │ └── vendor.json └── verify.go ├── head-node.yml ├── head.yml ├── help.mk ├── host_vars ├── cord-r6-s1 ├── cord-r6-s2 ├── cord-r6-s3 └── cord-r6-s4 ├── hosts ├── ip-allocator ├── Dockerfile.allocator ├── Makefile ├── allocate.go ├── allocator.go ├── handlers.go ├── ip.go ├── storage.go └── vendor │ ├── github.com │ ├── Sirupsen │ │ └── logrus │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── alt_exit.go │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_appengine.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_solaris.go │ │ │ ├── terminal_windows.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── gorilla │ │ └── mux │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── context_gorilla.go │ │ │ ├── context_native.go │ │ │ ├── doc.go │ │ │ ├── mux.go │ │ │ ├── regexp.go │ │ │ └── route.go │ └── kelseyhightower │ │ └── envconfig │ │ ├── LICENSE │ │ ├── MAINTAINERS │ │ ├── README.md │ │ ├── doc.go │ │ ├── env_os.go │ │ ├── env_syscall.go │ │ ├── envconfig.go │ │ └── usage.go │ └── vendor.json ├── library ├── maas.py ├── maas_boot_resource.py ├── maas_cluster.py ├── maas_cluster_interface.py ├── maas_item.py ├── maas_sshkey.py ├── maas_subnet.py ├── maas_user.py ├── maas_zone.py ├── netfile.py └── netinfo.py ├── prime-node.yml ├── provisioner ├── Dockerfile.provisioner ├── Makefile ├── ansible.cfg ├── consul_storage.go ├── dispatcher.go ├── handlers.go ├── provisioner.go ├── ssh-config ├── storage.go ├── task.go └── vendor │ ├── github.com │ ├── Sirupsen │ │ └── logrus │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── alt_exit.go │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_appengine.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_solaris.go │ │ │ ├── terminal_windows.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── gorilla │ │ └── mux │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── context_gorilla.go │ │ │ ├── context_native.go │ │ │ ├── doc.go │ │ │ ├── mux.go │ │ │ ├── regexp.go │ │ │ └── route.go │ ├── hashicorp │ │ ├── consul │ │ │ ├── LICENSE │ │ │ └── api │ │ │ │ ├── README.md │ │ │ │ ├── acl.go │ │ │ │ ├── agent.go │ │ │ │ ├── api.go │ │ │ │ ├── catalog.go │ │ │ │ ├── coordinate.go │ │ │ │ ├── event.go │ │ │ │ ├── health.go │ │ │ │ ├── kv.go │ │ │ │ ├── lock.go │ │ │ │ ├── operator.go │ │ │ │ ├── prepared_query.go │ │ │ │ ├── raw.go │ │ │ │ ├── semaphore.go │ │ │ │ ├── session.go │ │ │ │ ├── snapshot.go │ │ │ │ └── status.go │ │ ├── go-cleanhttp │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cleanhttp.go │ │ │ └── doc.go │ │ └── serf │ │ │ ├── LICENSE │ │ │ └── coordinate │ │ │ ├── client.go │ │ │ ├── config.go │ │ │ ├── coordinate.go │ │ │ └── phantom.go │ └── kelseyhightower │ │ └── envconfig │ │ ├── LICENSE │ │ ├── MAINTAINERS │ │ ├── README.md │ │ ├── doc.go │ │ ├── env_os.go │ │ ├── env_syscall.go │ │ ├── envconfig.go │ │ └── usage.go │ └── vendor.json ├── roles ├── ansible │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── compute-node │ ├── defaults │ │ └── main.yml │ ├── files │ │ ├── 99-cord-sudoers │ │ ├── config │ │ ├── delete-fabric-config │ │ ├── delete-node-prov-state │ │ ├── docker-ip │ │ ├── fabric-pingall │ │ ├── get-fabric-config │ │ ├── get-node-prov-state │ │ ├── i40e-1.4.25.tar.gz │ │ ├── post-fabric-config │ │ ├── pull-latest-docker-images │ │ ├── remove-maas-components │ │ └── remove-xos-components │ ├── meta │ │ └── main.yml │ └── tasks │ │ ├── i40e_driver.yml │ │ ├── main.yml │ │ ├── mlnx_driver.yml │ │ └── networking.yml ├── docker │ ├── defaults │ │ └── main.yml │ ├── files │ │ └── docker_apt_key.gpg │ ├── handlers │ │ └── main.yml │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── fabric-switch │ ├── defaults │ │ └── main.yml │ ├── meta │ │ └── main.yml │ ├── tasks │ │ ├── main.yml │ │ ├── ofdpa-accton.yml │ │ ├── ofdpa-quanta.yml │ │ ├── ofdpa.yml │ │ └── olt-accton.yml │ └── templates │ │ ├── connect │ │ └── killit ├── head-node │ ├── defaults │ │ └── main.yml │ ├── files │ │ ├── commands │ │ │ ├── cord │ │ │ ├── cord-generate │ │ │ ├── cord-harvest │ │ │ ├── cord-prov │ │ │ ├── cord-registry │ │ │ └── cord-switch │ │ ├── do-ansible │ │ └── do-switch │ ├── meta │ │ └── main.yml │ ├── tasks │ │ └── main.yml │ └── templates │ │ ├── compute-node-vars.yml.j2 │ │ ├── compute-node.yml.j2 │ │ ├── pod-inventory │ │ └── switch-node.yml.j2 ├── java8-oracle │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── local-ubuntu-repository │ ├── tasks │ │ └── main.yml │ └── templates │ │ └── sources.list.j2 ├── maas-user-privkey │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── maas-user-pubkey │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── maas │ ├── defaults │ │ └── main.yml │ ├── files │ │ ├── amt.template │ │ ├── dhcp_harvest.inc │ │ ├── dhcpd.blacklist │ │ ├── dhcpd.conf.template │ │ ├── dhcpd.reservations │ │ ├── dhcpd.reservations.sample │ │ ├── mappings.json │ │ ├── named.conf.options.inside.maas │ │ ├── power_discovery │ │ ├── ssh_config │ │ ├── uefi.py.diff │ │ ├── update_dns_template.sh │ │ └── zone.template │ ├── meta │ │ └── main.yml │ ├── tasks │ │ ├── config-maas.yml │ │ ├── main.yml │ │ ├── restart-maas.yml │ │ └── virtualbox.yml │ └── templates │ │ ├── automation-compose.yml.j2 │ │ ├── automation.env.j2 │ │ ├── cnames.inc.j2 │ │ ├── nat.j2 │ │ └── switchq.env.j2 ├── onos-fabric │ ├── defaults │ │ └── main.yml │ ├── files │ │ └── bin │ │ │ ├── minify │ │ │ ├── onos-cfg-delete │ │ │ ├── onos-cfg-get │ │ │ ├── onos-cfg-post │ │ │ ├── ping-test.sh │ │ │ └── restart-vms.sh │ ├── meta │ │ └── main.yml │ ├── tasks │ │ └── main.yml │ └── templates │ │ └── fabric-network-config.json.j2 ├── registry │ ├── files │ │ └── mirror-config.yml │ ├── meta │ │ └── main.yml │ ├── tasks │ │ └── main.yml │ └── templates │ │ └── registry-compose.yml.j2 └── ssh-key │ ├── defaults │ └── main.yml │ └── tasks │ └── main.yml ├── rules.mk ├── scripts └── bootstrap_ansible.sh ├── setup-ciab-pcu.yml ├── switchq ├── Dockerfile.switchq ├── Makefile ├── address.go ├── data.txt ├── handlers.go ├── switchq.go ├── sync.go ├── vendor │ ├── github.com │ │ ├── Sirupsen │ │ │ └── logrus │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── alt_exit.go │ │ │ │ ├── doc.go │ │ │ │ ├── entry.go │ │ │ │ ├── exported.go │ │ │ │ ├── formatter.go │ │ │ │ ├── hooks.go │ │ │ │ ├── json_formatter.go │ │ │ │ ├── logger.go │ │ │ │ ├── logrus.go │ │ │ │ ├── terminal_appengine.go │ │ │ │ ├── terminal_bsd.go │ │ │ │ ├── terminal_linux.go │ │ │ │ ├── terminal_notwindows.go │ │ │ │ ├── terminal_solaris.go │ │ │ │ ├── terminal_windows.go │ │ │ │ ├── text_formatter.go │ │ │ │ └── writer.go │ │ ├── gorilla │ │ │ └── mux │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── context_gorilla.go │ │ │ │ ├── context_native.go │ │ │ │ ├── doc.go │ │ │ │ ├── mux.go │ │ │ │ ├── regexp.go │ │ │ │ └── route.go │ │ ├── juju │ │ │ ├── ansiterm │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── attribute.go │ │ │ │ ├── color.go │ │ │ │ ├── context.go │ │ │ │ ├── doc.go │ │ │ │ ├── style.go │ │ │ │ ├── tabwriter.go │ │ │ │ ├── tabwriter │ │ │ │ │ └── tabwriter.go │ │ │ │ ├── terminal.go │ │ │ │ └── writer.go │ │ │ ├── errors │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ ├── error.go │ │ │ │ ├── errortypes.go │ │ │ │ ├── functions.go │ │ │ │ └── path.go │ │ │ ├── gomaasapi │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── README.rst │ │ │ │ ├── blockdevice.go │ │ │ │ ├── bootresource.go │ │ │ │ ├── client.go │ │ │ │ ├── controller.go │ │ │ │ ├── dependencies.tsv │ │ │ │ ├── device.go │ │ │ │ ├── enum.go │ │ │ │ ├── errors.go │ │ │ │ ├── fabric.go │ │ │ │ ├── file.go │ │ │ │ ├── filesystem.go │ │ │ │ ├── gomaasapi.go │ │ │ │ ├── interface.go │ │ │ │ ├── interfaces.go │ │ │ │ ├── jsonobject.go │ │ │ │ ├── link.go │ │ │ │ ├── maas.go │ │ │ │ ├── maasobject.go │ │ │ │ ├── machine.go │ │ │ │ ├── oauth.go │ │ │ │ ├── partition.go │ │ │ │ ├── space.go │ │ │ │ ├── subnet.go │ │ │ │ ├── testing.go │ │ │ │ ├── testservice.go │ │ │ │ ├── testservice_spaces.go │ │ │ │ ├── testservice_subnets.go │ │ │ │ ├── testservice_utils.go │ │ │ │ ├── testservice_vlan.go │ │ │ │ ├── urlparams.go │ │ │ │ ├── util.go │ │ │ │ ├── vlan.go │ │ │ │ └── zone.go │ │ │ ├── loggo │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── config.go │ │ │ │ ├── context.go │ │ │ │ ├── dependencies.tsv │ │ │ │ ├── doc.go │ │ │ │ ├── entry.go │ │ │ │ ├── formatter.go │ │ │ │ ├── global.go │ │ │ │ ├── level.go │ │ │ │ ├── logger.go │ │ │ │ ├── module.go │ │ │ │ ├── testwriter.go │ │ │ │ └── writer.go │ │ │ ├── schema │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── checker.go │ │ │ │ ├── const.go │ │ │ │ ├── errors.go │ │ │ │ ├── fieldmap.go │ │ │ │ ├── lists.go │ │ │ │ ├── maps.go │ │ │ │ ├── numeric.go │ │ │ │ ├── size.go │ │ │ │ ├── strings.go │ │ │ │ ├── time.go │ │ │ │ └── time_duration.go │ │ │ ├── utils │ │ │ │ ├── LICENSE │ │ │ │ ├── LICENSE.golang │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── attempt.go │ │ │ │ ├── clock │ │ │ │ │ ├── clock.go │ │ │ │ │ └── wall.go │ │ │ │ ├── command.go │ │ │ │ ├── dependencies.tsv │ │ │ │ ├── file.go │ │ │ │ ├── file_unix.go │ │ │ │ ├── file_windows.go │ │ │ │ ├── gomaxprocs.go │ │ │ │ ├── home_unix.go │ │ │ │ ├── home_windows.go │ │ │ │ ├── http-1_4.go │ │ │ │ ├── http-1_7.go │ │ │ │ ├── http.go │ │ │ │ ├── isubuntu.go │ │ │ │ ├── limiter.go │ │ │ │ ├── multireader.go │ │ │ │ ├── naturalsort.go │ │ │ │ ├── network.go │ │ │ │ ├── os.go │ │ │ │ ├── password.go │ │ │ │ ├── randomstring.go │ │ │ │ ├── relativeurl.go │ │ │ │ ├── set │ │ │ │ │ ├── ints.go │ │ │ │ │ ├── strings.go │ │ │ │ │ └── tags.go │ │ │ │ ├── size.go │ │ │ │ ├── systemerrmessages_unix.go │ │ │ │ ├── systemerrmessages_windows.go │ │ │ │ ├── timeit.go │ │ │ │ ├── timer.go │ │ │ │ ├── tls.go │ │ │ │ ├── trivial.go │ │ │ │ ├── username.go │ │ │ │ ├── uuid.go │ │ │ │ ├── yaml.go │ │ │ │ └── zfile_windows.go │ │ │ └── version │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ └── version.go │ │ ├── kelseyhightower │ │ │ └── envconfig │ │ │ │ ├── LICENSE │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ ├── env_os.go │ │ │ │ ├── env_syscall.go │ │ │ │ ├── envconfig.go │ │ │ │ └── usage.go │ │ ├── lunixbochs │ │ │ └── vtclean │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── io.go │ │ │ │ ├── line.go │ │ │ │ ├── regex.txt │ │ │ │ └── vtclean.go │ │ └── mattn │ │ │ ├── go-colorable │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── colorable_others.go │ │ │ ├── colorable_windows.go │ │ │ └── noncolorable.go │ │ │ └── go-isatty │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── isatty_appengine.go │ │ │ ├── isatty_bsd.go │ │ │ ├── isatty_linux.go │ │ │ ├── isatty_solaris.go │ │ │ └── isatty_windows.go │ ├── golang.org │ │ └── x │ │ │ └── crypto │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ └── pbkdf2 │ │ │ └── pbkdf2.go │ ├── gopkg.in │ │ ├── juju │ │ │ └── names.v2 │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── action.go │ │ │ │ ├── application.go │ │ │ │ ├── charm.go │ │ │ │ ├── cloud.go │ │ │ │ ├── cloudcredential.go │ │ │ │ ├── controller.go │ │ │ │ ├── environ.go │ │ │ │ ├── filesystem.go │ │ │ │ ├── ipaddress.go │ │ │ │ ├── machine.go │ │ │ │ ├── model.go │ │ │ │ ├── payload.go │ │ │ │ ├── relation.go │ │ │ │ ├── space.go │ │ │ │ ├── storage.go │ │ │ │ ├── subnet.go │ │ │ │ ├── tag.go │ │ │ │ ├── unit.go │ │ │ │ ├── user.go │ │ │ │ └── volume.go │ │ ├── mgo.v2 │ │ │ ├── LICENSE │ │ │ ├── bson │ │ │ │ ├── LICENSE │ │ │ │ ├── bson.go │ │ │ │ ├── decimal.go │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ └── json.go │ │ │ └── internal │ │ │ │ └── json │ │ │ │ ├── LICENSE │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── extension.go │ │ │ │ ├── fold.go │ │ │ │ ├── indent.go │ │ │ │ ├── scanner.go │ │ │ │ ├── stream.go │ │ │ │ └── tags.go │ │ └── yaml.v2 │ │ │ ├── LICENSE │ │ │ ├── LICENSE.libyaml │ │ │ ├── README.md │ │ │ ├── apic.go │ │ │ ├── decode.go │ │ │ ├── emitterc.go │ │ │ ├── encode.go │ │ │ ├── parserc.go │ │ │ ├── readerc.go │ │ │ ├── resolve.go │ │ │ ├── scannerc.go │ │ │ ├── sorter.go │ │ │ ├── writerc.go │ │ │ ├── yaml.go │ │ │ ├── yamlh.go │ │ │ └── yamlprivateh.go │ └── vendor.json ├── vendors.go └── vendors.json └── utils └── enable-remote-docker-registry /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=gerrit.opencord.org 3 | port=29418 4 | project=maas.git 5 | defaultremote=origin 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | We expect all ONF employees, member companies, and participants to abide by our [Code of Conduct](https://www.opennetworking.org/wp-content/themes/onf/img/onf-code-of-conduct.pdf). 2 | 3 | If you are being harassed, notice that someone else is being harassed, or have any other concerns involving someone’s welfare, please notify a member of the ONF team or email [conduct@opennetworking.org](conduct@opennetworking.org). 4 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | callback_whitelist = profile_tasks 3 | host_key_checking = false 4 | forks=20 5 | timeout=30 6 | 7 | [ssh_connection] 8 | ssh_args = -o ControlMaster=auto -o ControlPersist=15s -o ConnectionAttempts=20 9 | retries=5 10 | 11 | -------------------------------------------------------------------------------- /ansible/fakeswitch.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: localhost 18 | remote_user: vagrant 19 | serial: 1 20 | roles: 21 | - common 22 | - fakeswitch 23 | -------------------------------------------------------------------------------- /ansible/group_vars/all: -------------------------------------------------------------------------------- 1 | ip: "{{ facter_ipaddress_eth1 }}" 2 | consul_extra: "" 3 | proxy_url: http://{{ facter_ipaddress_eth1 }} 4 | proxy_url2: http://{{ facter_ipaddress_eth1 }} 5 | registry_url: 10.100.198.200:5000/ 6 | jenkins_ip: 10.100.198.200 7 | docker_cfg: docker.cfg 8 | docker_cfg_dest: /etc/default/docker 9 | -------------------------------------------------------------------------------- /ansible/headnode.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: localhost 18 | remote_user: vagrant 19 | serial: 1 20 | roles: 21 | - maas 22 | -------------------------------------------------------------------------------- /ansible/maasdev.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: localhost 18 | remote_user: vagrant 19 | serial: 1 20 | roles: 21 | - common 22 | - docker 23 | - docker-compose 24 | - consul-template 25 | - registry 26 | - java8-oracle 27 | -------------------------------------------------------------------------------- /ansible/roles/common/defaults/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | hosts: [ 18 | { host_ip: "10.100.198.200", host_name: "maasdev"}, 19 | { host_ip: "10.100.198.201", host_name: "prod"}, 20 | ] 21 | 22 | use_latest_for: 23 | - debian-keyring 24 | - debian-archive-keyring 25 | - rng-tools 26 | 27 | obsolete_services: 28 | - puppet 29 | - chef-client 30 | -------------------------------------------------------------------------------- /ansible/roles/common/files/ssh-config: -------------------------------------------------------------------------------- 1 | Host * 2 | StrictHostKeyChecking no 3 | UserKnownHostsFile=/dev/null 4 | -------------------------------------------------------------------------------- /ansible/roles/consul-template/files/consul-template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencord/maas/6f6491879619cc5d55ac0ee0dc8ee911d3b62832/ansible/roles/consul-template/files/consul-template -------------------------------------------------------------------------------- /ansible/roles/consul-template/files/example.conf.tmpl: -------------------------------------------------------------------------------- 1 | The address is {{getv "/nginx/nginx"}} 2 | -------------------------------------------------------------------------------- /ansible/roles/consul-template/files/example.ctmpl: -------------------------------------------------------------------------------- 1 | {{range service "nginx"}} 2 | The address is {{.Address}}:{{.Port}} 3 | {{end}} 4 | -------------------------------------------------------------------------------- /ansible/roles/consul-template/files/example.toml: -------------------------------------------------------------------------------- 1 | [template] 2 | src = "example.conf.tmpl" 3 | dest = "/tmp/example.conf" 4 | keys = [ 5 | "/nginx/nginx" 6 | ] -------------------------------------------------------------------------------- /ansible/roles/docker-compose/tasks/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - name: Executable is present 18 | get_url: 19 | url: https://github.com/docker/compose/releases/download/1.7.1/docker-compose-Linux-x86_64 20 | dest: /usr/local/bin/docker-compose 21 | mode: "0755" 22 | -------------------------------------------------------------------------------- /ansible/roles/docker/defaults/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | docker_extra: "" 18 | 19 | centos_files: [ 20 | { src: "docker.centos.repo", dest: "/etc/yum.repos.d/docker.repo" }, 21 | { src: "docker.centos.service", dest: "/lib/systemd/system/docker.service" }, 22 | ] -------------------------------------------------------------------------------- /ansible/roles/docker/files/docker.centos.repo: -------------------------------------------------------------------------------- 1 | [dockerrepo] 2 | name=Docker Repository 3 | baseurl=https://yum.dockerproject.org/repo/main/centos/7 4 | enabled=1 5 | gpgcheck=1 6 | gpgkey=https://yum.dockerproject.org/gpg -------------------------------------------------------------------------------- /ansible/roles/docker/files/docker.centos.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Application Container Engine 3 | Documentation=https://docs.docker.com 4 | After=network.target docker.socket 5 | Requires=docker.socket 6 | 7 | [Service] 8 | EnvironmentFile=-/etc/sysconfig/docker 9 | Type=notify 10 | ExecStart=/usr/bin/docker daemon --insecure-registry 10.100.198.200:5000 -H fd:// 11 | MountFlags=slave 12 | LimitNOFILE=1048576 13 | LimitNPROC=1048576 14 | LimitCORE=infinity 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /ansible/roles/docker/tasks/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - include: debian.yml 18 | when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' 19 | 20 | - include: centos.yml 21 | when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' 22 | -------------------------------------------------------------------------------- /ansible/roles/docker/templates/docker-swarm-master.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Application Container Engine 3 | Documentation=https://docs.docker.com 4 | After=network.target docker.socket 5 | Requires=docker.socket 6 | 7 | [Service] 8 | Type=notify 9 | ExecStart=/usr/bin/docker daemon -H fd:// \ 10 | --insecure-registry 10.100.198.200:5000 \ 11 | --registry-mirror=http://10.100.198.200:5001 \ 12 | --cluster-store=consul://{{ ip }}:8500/swarm \ 13 | --cluster-advertise={{ ip }}:2375 {{ docker_extra }} 14 | MountFlags=master 15 | LimitNOFILE=1048576 16 | LimitNPROC=1048576 17 | LimitCORE=infinity 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | 22 | -------------------------------------------------------------------------------- /ansible/roles/docker/templates/docker-swarm-node.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Application Container Engine 3 | Documentation=https://docs.docker.com 4 | After=network.target docker.socket 5 | Requires=docker.socket 6 | 7 | [Service] 8 | Type=notify 9 | ExecStart=/usr/bin/docker daemon -H fd:// \ 10 | -H tcp://0.0.0.0:2375 \ 11 | -H unix:///var/run/docker.sock \ 12 | --insecure-registry 10.100.198.200:5000 \ 13 | --registry-mirror=http://10.100.198.200:5001 \ 14 | --cluster-store=consul://{{ ip }}:8500/swarm \ 15 | --cluster-advertise={{ ip }}:2375 {{ docker_extra }} 16 | MountFlags=slave 17 | LimitNOFILE=1048576 18 | LimitNPROC=1048576 19 | LimitCORE=infinity 20 | 21 | [Install] 22 | WantedBy=multi-user.target 23 | 24 | -------------------------------------------------------------------------------- /ansible/roles/docker/templates/docker.cfg: -------------------------------------------------------------------------------- 1 | DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 10.100.198.200:5000 -H unix:///var/run/docker.sock --registry-mirror=http://10.100.198.200:5001" 2 | DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 10.100.198.201:5000" 3 | 4 | -------------------------------------------------------------------------------- /ansible/roles/fakeswitch/files/persist: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "persist" 3 | exit 0 4 | -------------------------------------------------------------------------------- /ansible/roles/fakeswitch/files/savepersist: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "savepersist" 3 | exit 0 4 | -------------------------------------------------------------------------------- /automation/Makefile: -------------------------------------------------------------------------------- 1 | IMAGES+=automation 2 | 3 | automation.image: Dockerfile.automation *.go vendor/vendor.json 4 | 5 | include ../rules.mk 6 | -------------------------------------------------------------------------------- /automation/lifecycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencord/maas/6f6491879619cc5d55ac0ee0dc8ee911d3b62832/automation/lifecycle.png -------------------------------------------------------------------------------- /automation/mappings.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /automation/sample-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosts":{ 3 | "include":[ 4 | ".*" 5 | ] 6 | }, 7 | "zones":{ 8 | "include":[ 9 | "default", 10 | "petaluma-lab" 11 | ] 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /automation/vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /automation/vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /automation/vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /automation/vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /automation/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /automation/vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /automation/vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/ansiterm/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Canonical Ltd. 2 | # Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | default: check 5 | 6 | check: 7 | go test 8 | 9 | docs: 10 | godoc2md github.com/juju/ansiterm > README.md 11 | sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/ansiterm?status.svg)](https://godoc.org/github.com/juju/ansiterm)|' README.md 12 | 13 | 14 | .PHONY: default check docs 15 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/ansiterm/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | // Package ansiterm provides a Writer that writes out the ANSI escape 5 | // codes for color and styles. 6 | package ansiterm 7 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/ansiterm/terminal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package ansiterm 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | "github.com/mattn/go-colorable" 11 | "github.com/mattn/go-isatty" 12 | ) 13 | 14 | // colorEnabledWriter returns a writer that can handle the ansi color codes 15 | // and true if the writer passed in is a terminal capable of color. If the 16 | // TERM environment variable is set to "dumb", the terminal is not considered 17 | // color capable. 18 | func colorEnabledWriter(w io.Writer) (io.Writer, bool) { 19 | f, ok := w.(*os.File) 20 | if !ok { 21 | return w, false 22 | } 23 | // Check the TERM environment variable specifically 24 | // to check for "dumb" terminals. 25 | if os.Getenv("TERM") == "dumb" { 26 | return w, false 27 | } 28 | if !isatty.IsTerminal(f.Fd()) { 29 | return w, false 30 | } 31 | return colorable.NewColorable(f), true 32 | } 33 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/errors/Makefile: -------------------------------------------------------------------------------- 1 | default: check 2 | 3 | check: 4 | go test && go test -compiler gccgo 5 | 6 | docs: 7 | godoc2md github.com/juju/errors > README.md 8 | sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors)|' README.md 9 | 10 | 11 | .PHONY: default check docs 12 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/errors/path.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, 2014 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package errors 5 | 6 | import ( 7 | "runtime" 8 | "strings" 9 | ) 10 | 11 | // prefixSize is used internally to trim the user specific path from the 12 | // front of the returned filenames from the runtime call stack. 13 | var prefixSize int 14 | 15 | // goPath is the deduced path based on the location of this file as compiled. 16 | var goPath string 17 | 18 | func init() { 19 | _, file, _, ok := runtime.Caller(0) 20 | if file == "?" { 21 | return 22 | } 23 | if ok { 24 | // We know that the end of the file should be: 25 | // github.com/juju/errors/path.go 26 | size := len(file) 27 | suffix := len("github.com/juju/errors/path.go") 28 | goPath = file[:size-suffix] 29 | prefixSize = len(goPath) 30 | } 31 | } 32 | 33 | func trimGoPath(filename string) string { 34 | if strings.HasPrefix(filename, goPath) { 35 | return filename[prefixSize:] 36 | } 37 | return filename 38 | } 39 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/gomaasapi/Makefile: -------------------------------------------------------------------------------- 1 | # Build, and run tests. 2 | check: examples 3 | go test ./... 4 | 5 | example_source := $(wildcard example/*.go) 6 | example_binaries := $(patsubst %.go,%,$(example_source)) 7 | 8 | # Clean up binaries. 9 | clean: 10 | $(RM) $(example_binaries) 11 | 12 | # Reformat the source files to match our layout standards. 13 | format: 14 | gofmt -w . 15 | 16 | # Invoke gofmt's "simplify" option to streamline the source code. 17 | simplify: 18 | gofmt -w -s . 19 | 20 | # Build the examples (we have no tests for them). 21 | examples: $(example_binaries) 22 | 23 | %: %.go 24 | go build -o $@ $< 25 | 26 | .PHONY: check clean format examples simplify 27 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/gomaasapi/README.rst: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ****************************** 4 | MAAS API client library for Go 5 | ****************************** 6 | 7 | This library serves as a minimal client for communicating with the MAAS web 8 | API in Go programs. 9 | 10 | For more information see the `project homepage`_. 11 | 12 | .. _project homepage: https://github.com/juju/gomaasapi 13 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/gomaasapi/dependencies.tsv: -------------------------------------------------------------------------------- 1 | github.com/juju/errors git 1b5e39b83d1835fa480e0c2ddefb040ee82d58b3 2015-09-16T12:56:42Z 2 | github.com/juju/loggo git 8477fc936adf0e382d680310047ca27e128a309a 2015-05-27T03:58:39Z 3 | github.com/juju/names git 8a0aa0963bbacdc790914892e9ff942e94d6f795 2016-03-30T15:05:33Z 4 | github.com/juju/schema git 075de04f9b7d7580d60a1e12a0b3f50bb18e6998 2016-04-20T04:42:03Z 5 | github.com/juju/testing git 162fafccebf20a4207ab93d63b986c230e3f4d2e 2016-04-04T09:43:17Z 6 | github.com/juju/utils git eb6cb958762135bb61aed1e0951f657c674d427f 2016-04-11T02:40:59Z 7 | github.com/juju/version git ef897ad7f130870348ce306f61332f5335355063 2015-11-27T20:34:00Z 8 | golang.org/x/crypto git aedad9a179ec1ea11b7064c57cbc6dc30d7724ec 2015-08-30T18:06:42Z 9 | gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z 10 | gopkg.in/mgo.v2 git 4d04138ffef2791c479c0c8bbffc30b34081b8d9 2015-10-26T16:34:53Z 11 | gopkg.in/yaml.v2 git a83829b6f1293c91addabc89d0571c246397bbf4 2016-03-01T20:40:22Z 12 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/gomaasapi/gomaasapi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/gomaasapi/maas.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | 6 | // NewMAAS returns an interface to the MAAS API as a *MAASObject. 7 | func NewMAAS(client Client) *MAASObject { 8 | attrs := map[string]interface{}{resourceURI: client.APIURL.String()} 9 | obj := newJSONMAASObject(attrs, client) 10 | return &obj 11 | } 12 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/gomaasapi/testservice_vlan.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | 6 | import ( 7 | "fmt" 8 | "net/http" 9 | ) 10 | 11 | func getVLANsEndpoint(version string) string { 12 | return fmt.Sprintf("/api/%s/vlans/", version) 13 | } 14 | 15 | // TestVLAN is the MAAS API VLAN representation 16 | type TestVLAN struct { 17 | Name string `json:"name"` 18 | Fabric string `json:"fabric"` 19 | VID uint `json:"vid"` 20 | 21 | ResourceURI string `json:"resource_uri"` 22 | ID uint `json:"id"` 23 | } 24 | 25 | // PostedVLAN is the MAAS API posted VLAN representation 26 | type PostedVLAN struct { 27 | Name string `json:"name"` 28 | VID uint `json:"vid"` 29 | } 30 | 31 | func vlansHandler(server *TestServer, w http.ResponseWriter, r *http.Request) { 32 | //TODO 33 | } 34 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/gomaasapi/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | 6 | import ( 7 | "strings" 8 | ) 9 | 10 | // JoinURLs joins a base URL and a subpath together. 11 | // Regardless of whether baseURL ends in a trailing slash (or even multiple 12 | // trailing slashes), or whether there are any leading slashes at the begining 13 | // of path, the two will always be joined together by a single slash. 14 | func JoinURLs(baseURL, path string) string { 15 | return strings.TrimRight(baseURL, "/") + "/" + strings.TrimLeft(path, "/") 16 | } 17 | 18 | // EnsureTrailingSlash appends a slash at the end of the given string unless 19 | // there already is one. 20 | // This is used to create the kind of normalized URLs that Django expects. 21 | // (to avoid Django's redirection when an URL does not ends with a slash.) 22 | func EnsureTrailingSlash(URL string) string { 23 | if strings.HasSuffix(URL, "/") { 24 | return URL 25 | } 26 | return URL + "/" 27 | } 28 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/loggo/Makefile: -------------------------------------------------------------------------------- 1 | default: check 2 | 3 | check: 4 | go test 5 | 6 | docs: 7 | godoc2md github.com/juju/loggo > README.md 8 | sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/loggo?status.svg)](https://godoc.org/github.com/juju/loggo)|' README.md 9 | 10 | 11 | .PHONY: default check docs 12 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/loggo/dependencies.tsv: -------------------------------------------------------------------------------- 1 | github.com/juju/ansiterm git c368f42cb4b32a70389cded05c7345d9ccdce889 2016-08-17T02:52:20Z 2 | github.com/lunixbochs/vtclean git 4fbf7632a2c6d3fbdb9931439bdbbeded02cbe36 2016-01-25T03:51:06Z 3 | github.com/mattn/go-colorable git ed8eb9e318d7a84ce5915b495b7d35e0cfe7b5a8 2016-07-31T23:54:17Z 4 | github.com/mattn/go-isatty git 66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8 2016-08-06T12:27:52Z 5 | gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z 6 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/loggo/entry.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package loggo 5 | 6 | import "time" 7 | 8 | // Entry represents a single log message. 9 | type Entry struct { 10 | // Level is the severity of the log message. 11 | Level Level 12 | // Module is the dotted module name from the logger. 13 | Module string 14 | // Filename is the full path the file that logged the message. 15 | Filename string 16 | // Line is the line number of the Filename. 17 | Line int 18 | // Timestamp is when the log message was created 19 | Timestamp time.Time 20 | // Message is the formatted string from teh log call. 21 | Message string 22 | } 23 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/schema/README.md: -------------------------------------------------------------------------------- 1 | juju/schema 2 | =========== 3 | 4 | This package provides helpers for coercing dynamically typed data structures 5 | into known forms. 6 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/schema/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package schema 5 | 6 | import ( 7 | "fmt" 8 | ) 9 | 10 | type error_ struct { 11 | want string 12 | got interface{} 13 | path []string 14 | } 15 | 16 | func (e error_) Error() string { 17 | path := pathAsPrefix(e.path) 18 | if e.want == "" { 19 | return fmt.Sprintf("%sunexpected value %#v", path, e.got) 20 | } 21 | if e.got == nil { 22 | return fmt.Sprintf("%sexpected %s, got nothing", path, e.want) 23 | } 24 | return fmt.Sprintf("%sexpected %s, got %T(%#v)", path, e.want, e.got, e.got) 25 | } 26 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/schema/size.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package schema 5 | 6 | import ( 7 | "github.com/juju/utils" 8 | "reflect" 9 | ) 10 | 11 | // Size returns a Checker that accepts a string value, and returns 12 | // the parsed string as a size in mebibytes see: https://godoc.org/github.com/juju/utils#ParseSize 13 | func Size() Checker { 14 | return sizeC{} 15 | } 16 | 17 | type sizeC struct{} 18 | 19 | // Coerce implements Checker Coerce method. 20 | func (c sizeC) Coerce(v interface{}, path []string) (interface{}, error) { 21 | if v == nil { 22 | return nil, error_{"string", v, path} 23 | } 24 | 25 | typeOf := reflect.TypeOf(v).Kind() 26 | if typeOf != reflect.String { 27 | return nil, error_{"string", v, path} 28 | } 29 | 30 | value := reflect.ValueOf(v).String() 31 | if value == "" { 32 | return nil, error_{"empty string", v, path} 33 | } 34 | 35 | v, err := utils.ParseSize(value) 36 | 37 | if err != nil { 38 | return nil, err 39 | } 40 | 41 | return v, nil 42 | } 43 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/Makefile: -------------------------------------------------------------------------------- 1 | PROJECT := github.com/juju/utils 2 | 3 | check-licence: 4 | @(fgrep -rl "Licensed under the LGPLv3" .;\ 5 | fgrep -rl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" .;\ 6 | find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ 7 | xargs -I {} echo FAIL: licence missed: {} 8 | 9 | check: check-licence 10 | go test $(PROJECT)/... -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/README.md: -------------------------------------------------------------------------------- 1 | juju/utils 2 | ============ 3 | 4 | This package provides general utility packages and functions. 5 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/command.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "os/exec" 8 | ) 9 | 10 | // RunCommand executes the command and return the combined output. 11 | func RunCommand(command string, args ...string) (output string, err error) { 12 | cmd := exec.Command(command, args...) 13 | out, err := cmd.CombinedOutput() 14 | output = string(out) 15 | if err != nil { 16 | return output, err 17 | } 18 | return output, nil 19 | } 20 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/gomaxprocs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "os" 8 | "runtime" 9 | ) 10 | 11 | var gomaxprocs = runtime.GOMAXPROCS 12 | var numCPU = runtime.NumCPU 13 | 14 | // UseMultipleCPUs sets GOMAXPROCS to the number of CPU cores unless it has 15 | // already been overridden by the GOMAXPROCS environment variable. 16 | func UseMultipleCPUs() { 17 | if envGOMAXPROCS := os.Getenv("GOMAXPROCS"); envGOMAXPROCS != "" { 18 | n := gomaxprocs(0) 19 | logger.Debugf("GOMAXPROCS already set in environment to %q, %d internally", 20 | envGOMAXPROCS, n) 21 | return 22 | } 23 | n := numCPU() 24 | logger.Debugf("setting GOMAXPROCS to %d", n) 25 | gomaxprocs(n) 26 | } 27 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/home_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | // +build !windows 4 | 5 | package utils 6 | 7 | import ( 8 | "os" 9 | ) 10 | 11 | // Home returns the os-specific home path as specified in the environment. 12 | func Home() string { 13 | return os.Getenv("HOME") 14 | } 15 | 16 | // SetHome sets the os-specific home path in the environment. 17 | func SetHome(s string) error { 18 | return os.Setenv("HOME", s) 19 | } 20 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/home_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "os" 8 | "path/filepath" 9 | ) 10 | 11 | // Home returns the os-specific home path as specified in the environment. 12 | func Home() string { 13 | return filepath.Join(os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH")) 14 | } 15 | 16 | // SetHome sets the os-specific home path in the environment. 17 | func SetHome(s string) error { 18 | v := filepath.VolumeName(s) 19 | if v != "" { 20 | if err := os.Setenv("HOMEDRIVE", v); err != nil { 21 | return err 22 | } 23 | } 24 | return os.Setenv("HOMEPATH", s[len(v):]) 25 | } 26 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/http-1_4.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | //+build !go1.7 5 | 6 | package utils 7 | 8 | import ( 9 | "fmt" 10 | "net" 11 | "net/http" 12 | ) 13 | 14 | // installHTTPDialShim patches the default HTTP transport so 15 | // that it fails when an attempt is made to dial a non-local 16 | // host. 17 | func installHTTPDialShim(t *http.Transport) { 18 | t.Dial = func(network, addr string) (net.Conn, error) { 19 | if !OutgoingAccessAllowed && !isLocalAddr(addr) { 20 | return nil, fmt.Errorf("access to address %q not allowed", addr) 21 | } 22 | return net.Dial(network, addr) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/http-1_7.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | //+build go1.7 5 | 6 | package utils 7 | 8 | import ( 9 | "context" 10 | "fmt" 11 | "net" 12 | "net/http" 13 | "time" 14 | ) 15 | 16 | var ctxtDialer = &net.Dialer{ 17 | Timeout: 30 * time.Second, 18 | KeepAlive: 30 * time.Second, 19 | } 20 | 21 | // installHTTPDialShim patches the default HTTP transport so 22 | // that it fails when an attempt is made to dial a non-local 23 | // host. 24 | // 25 | // Note that this is Go version dependent because in Go 1.7 and above, 26 | // the DialContext field was introduced (and set in http.DefaultTransport) 27 | // which overrides the Dial field. 28 | func installHTTPDialShim(t *http.Transport) { 29 | t.DialContext = func(ctxt context.Context, network, addr string) (net.Conn, error) { 30 | if !OutgoingAccessAllowed && !isLocalAddr(addr) { 31 | return nil, fmt.Errorf("access to address %q not allowed", addr) 32 | } 33 | return ctxtDialer.DialContext(ctxt, network, addr) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/isubuntu.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011, 2012, 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "strings" 8 | ) 9 | 10 | // IsUbuntu executes lxb_release to see if the host OS is Ubuntu. 11 | func IsUbuntu() bool { 12 | out, err := RunCommand("lsb_release", "-i", "-s") 13 | if err != nil { 14 | return false 15 | } 16 | return strings.TrimSpace(out) == "Ubuntu" 17 | } 18 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/os.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | // These are the names of the operating systems recognized by Go. 7 | const ( 8 | OSWindows = "windows" 9 | OSDarwin = "darwin" 10 | OSDragonfly = "dragonfly" 11 | OSFreebsd = "freebsd" 12 | OSLinux = "linux" 13 | OSNacl = "nacl" 14 | OSNetbsd = "netbsd" 15 | OSOpenbsd = "openbsd" 16 | OSSolaris = "solaris" 17 | ) 18 | 19 | // OSUnix is the list of unix-like operating systems recognized by Go. 20 | // See http://golang.org/src/path/filepath/path_unix.go. 21 | var OSUnix = []string{ 22 | OSDarwin, 23 | OSDragonfly, 24 | OSFreebsd, 25 | OSLinux, 26 | OSNacl, 27 | OSNetbsd, 28 | OSOpenbsd, 29 | OSSolaris, 30 | } 31 | 32 | // OSIsUnix determines whether or not the given OS name is one of the 33 | // unix-like operating systems recognized by Go. 34 | func OSIsUnix(os string) bool { 35 | for _, goos := range OSUnix { 36 | if os == goos { 37 | return true 38 | } 39 | } 40 | return false 41 | } 42 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/randomstring.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "math/rand" 8 | "sync" 9 | "time" 10 | ) 11 | 12 | // Can be used as a sane default argument for RandomString 13 | var ( 14 | LowerAlpha = []rune("abcdefghijklmnopqrstuvwxyz") 15 | UpperAlpha = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ") 16 | Digits = []rune("0123456789") 17 | ) 18 | 19 | var ( 20 | randomStringMu sync.Mutex 21 | randomStringRand *rand.Rand 22 | ) 23 | 24 | func init() { 25 | randomStringRand = rand.New( 26 | rand.NewSource(time.Now().UnixNano()), 27 | ) 28 | } 29 | 30 | // RandomString will return a string of length n that will only 31 | // contain runes inside validRunes 32 | func RandomString(n int, validRunes []rune) string { 33 | randomStringMu.Lock() 34 | defer randomStringMu.Unlock() 35 | 36 | runes := make([]rune, n) 37 | for i := range runes { 38 | runes[i] = validRunes[randomStringRand.Intn(len(validRunes))] 39 | } 40 | 41 | return string(runes) 42 | } 43 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/systemerrmessages_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Canonical Ltd. 2 | // Copyright 2014 Cloudbase Solutions SRL 3 | // Licensed under the LGPLv3, see LICENCE file for details. 4 | 5 | // +build !windows 6 | 7 | package utils 8 | 9 | // The following are strings/regex-es which match common Unix error messages 10 | // that may be returned in case of failed calls to the system. 11 | // Any extra leading/trailing regex-es are left to be added by the developer. 12 | const ( 13 | NoSuchUserErrRegexp = `user: unknown user [a-z0-9_-]*` 14 | NoSuchFileErrRegexp = `no such file or directory` 15 | MkdirFailErrRegexp = `.* not a directory` 16 | ) 17 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/systemerrmessages_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Canonical Ltd. 2 | // Copyright 2014 Cloudbase Solutions SRL 3 | // Licensed under the LGPLv3, see LICENCE file for details. 4 | 5 | package utils 6 | 7 | // The following are strings/regex-es which match common Windows error messages 8 | // that may be returned in case of failed calls to the system. 9 | // Any extra leading/trailing regex-es are left to be added by the developer. 10 | const ( 11 | NoSuchUserErrRegexp = `No mapping between account names and security IDs was done\.` 12 | NoSuchFileErrRegexp = `The system cannot find the (file|path) specified\.` 13 | MkdirFailErrRegexp = `mkdir .*` + NoSuchFileErrRegexp 14 | ) 15 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/utils/zfile_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | // mksyscall_windows.pl -l32 file_windows.go 5 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 6 | 7 | package utils 8 | 9 | import "unsafe" 10 | import "syscall" 11 | 12 | var ( 13 | modkernel32 = syscall.NewLazyDLL("kernel32.dll") 14 | 15 | procMoveFileExW = modkernel32.NewProc("MoveFileExW") 16 | ) 17 | 18 | func moveFileEx(lpExistingFileName *uint16, lpNewFileName *uint16, dwFlags uint32) (err error) { 19 | r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(lpExistingFileName)), uintptr(unsafe.Pointer(lpNewFileName)), uintptr(dwFlags)) 20 | if r1 == 0 { 21 | if e1 != 0 { 22 | err = error(e1) 23 | } else { 24 | err = syscall.EINVAL 25 | } 26 | } 27 | return 28 | } 29 | -------------------------------------------------------------------------------- /automation/vendor/github.com/juju/version/README.md: -------------------------------------------------------------------------------- 1 | # Version [![GoDoc](https://godoc.org/github.com/juju/version?status.svg)](https://godoc.org/github.com/juju/version) 2 | version is a go package for intelligent version comparisons. 3 | 4 | -------------------------------------------------------------------------------- /automation/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Kelsey Hightower kelsey.hightower@gmail.com github.com/kelseyhightower 2 | Travis Parker travis.parker@gmail.com github.com/teepark 3 | -------------------------------------------------------------------------------- /automation/vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /automation/vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /automation/vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /automation/vendor/github.com/lunixbochs/vtclean/README.md: -------------------------------------------------------------------------------- 1 | vtclean 2 | ---- 3 | 4 | Clean up raw terminal output by stripping escape sequences, optionally preserving color. 5 | 6 | Get it: `go get github.com/lunixbochs/vtclean/vtclean` 7 | 8 | API: 9 | 10 | import "github.com/lunixbochs/vtclean" 11 | vtclean.Clean(line string, color bool) string 12 | 13 | Command line example: 14 | 15 | $ echo -e '\x1b[1;32mcolor example 16 | color forced to stop at end of line 17 | backspace is ba\b\bgood 18 | no beeps!\x07\x07' | ./vtclean -color 19 | 20 | color example 21 | color forced to stop at end of line 22 | backspace is good 23 | no beeps! 24 | 25 | Go example: 26 | 27 | package main 28 | 29 | import ( 30 | "fmt" 31 | "github.com/lunixbochs/vtclean" 32 | ) 33 | 34 | func main() { 35 | line := vtclean.Clean( 36 | "\033[1;32mcolor, " + 37 | "curs\033[Aor, " + 38 | "backspace\b\b\b\b\b\b\b\b\b\b\b\033[K", false) 39 | fmt.Println(line) 40 | } 41 | 42 | Output: 43 | 44 | color, cursor 45 | -------------------------------------------------------------------------------- /automation/vendor/github.com/lunixbochs/vtclean/regex.txt: -------------------------------------------------------------------------------- 1 | this is the source definitions for the scary escape code regex 2 | 3 | # from tests in Terminal.app, this regex should cover all basic \e[ and \e] cases 4 | ^([\[\]]([\d\?]+)?(;[\d\?]+)*)?. 5 | 6 | # this catches any case the above does not 7 | # make sure to not include any special characters the main regex finds (like ?) 8 | \[[^a-zA-Z0-9@\?]+. 9 | 10 | # esc + paren + any single char 11 | [\(\)]. 12 | 13 | # didn't re-check this one (not included) 14 | [\[K]\d+;\d+ 15 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | Colorable writer for windows. 4 | 5 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 6 | This package is possible to handle escape sequence for ansi color on windows. 7 | 8 | ## Too Bad! 9 | 10 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 11 | 12 | 13 | ## So Good! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 16 | 17 | ## Usage 18 | 19 | ```go 20 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 21 | logrus.SetOutput(colorable.NewColorableStdout()) 22 | 23 | logrus.Info("succeeded") 24 | logrus.Warn("not correct") 25 | logrus.Error("something error") 26 | logrus.Fatal("panic") 27 | ``` 28 | 29 | You can compile above code on non-windows OSs. 30 | 31 | ## Installation 32 | 33 | ``` 34 | $ go get github.com/mattn/go-colorable 35 | ``` 36 | 37 | # License 38 | 39 | MIT 40 | 41 | # Author 42 | 43 | Yasuhiro Matsumoto (a.k.a mattn) 44 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // NewColorable return new instance of Writer which handle escape sequence. 11 | func NewColorable(file *os.File) io.Writer { 12 | if file == nil { 13 | panic("nil passed instead of *os.File to NewColorable()") 14 | } 15 | 16 | return file 17 | } 18 | 19 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 20 | func NewColorableStdout() io.Writer { 21 | return os.Stdout 22 | } 23 | 24 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 25 | func NewColorableStderr() io.Writer { 26 | return os.Stderr 27 | } 28 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | isatty for golang 4 | 5 | ## Usage 6 | 7 | ```go 8 | package main 9 | 10 | import ( 11 | "fmt" 12 | "github.com/mattn/go-isatty" 13 | "os" 14 | ) 15 | 16 | func main() { 17 | if isatty.IsTerminal(os.Stdout.Fd()) { 18 | fmt.Println("Is Terminal") 19 | } else { 20 | fmt.Println("Is Not Terminal") 21 | } 22 | } 23 | ``` 24 | 25 | ## Installation 26 | 27 | ``` 28 | $ go get github.com/mattn/go-isatty 29 | ``` 30 | 31 | # License 32 | 33 | MIT 34 | 35 | # Author 36 | 37 | Yasuhiro Matsumoto (a.k.a mattn) 38 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /automation/vendor/github.com/mattn/go-isatty/isatty_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 12 | var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var st uint32 17 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 18 | return r != 0 && e == 0 19 | } 20 | -------------------------------------------------------------------------------- /automation/vendor/gopkg.in/juju/names.v2/README.md: -------------------------------------------------------------------------------- 1 | juju/names 2 | ============ 3 | 4 | This package provides helpers for handling Juju entity names. 5 | -------------------------------------------------------------------------------- /automation/vendor/gopkg.in/yaml.v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /compute-node.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: all 18 | remote_user: ubuntu 19 | roles: 20 | - compute-node 21 | -------------------------------------------------------------------------------- /compute.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: compute 18 | roles: 19 | - compute-node 20 | -------------------------------------------------------------------------------- /config-generator/Makefile: -------------------------------------------------------------------------------- 1 | IMAGES+=generator 2 | 3 | generator.image: netconfig.tpl Dockerfile.generator *.go vendor/vendor.json 4 | 5 | include ../rules.mk 6 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/gorilla/mux/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Kelsey Hightower kelsey.hightower@gmail.com github.com/kelseyhightower 2 | Travis Parker travis.parker@gmail.com github.com/teepark 3 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /config-generator/vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /config-generator/vendor/vendor.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": "", 3 | "ignore": "test", 4 | "package": [ 5 | { 6 | "checksumSHA1": "dGXnnR7ZhsrZNnEqFimk6q7YCqs=", 7 | "path": "github.com/Sirupsen/logrus", 8 | "revision": "61e43dc76f7ee59a82bdf3d71033dc12bea4c77d", 9 | "revisionTime": "2017-01-13T01:19:11Z" 10 | }, 11 | { 12 | "checksumSHA1": "F5dR3/i70EhSIMZfeIV+H8/PtvM=", 13 | "path": "github.com/gorilla/mux", 14 | "revision": "392c28fe23e1c45ddba891b0320b3b5df220beea", 15 | "revisionTime": "2017-01-18T13:43:44Z" 16 | }, 17 | { 18 | "checksumSHA1": "pNria08/hqW7nnWb0erRBMdJU3M=", 19 | "path": "github.com/kelseyhightower/envconfig", 20 | "revision": "4069f29f08928c54bcb1fdf632b31b1bb54b4fdb", 21 | "revisionTime": "2017-01-13T19:16:37Z" 22 | } 23 | ], 24 | "rootPath": "gerrit.opencord.org/maas/config-generator" 25 | } 26 | -------------------------------------------------------------------------------- /dev-head-node.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: all 18 | remote_user: vagrant 19 | serial: 1 20 | vars: 21 | virtualbox_support: 1 22 | ansible_ssh_pass: vagrant 23 | roles: 24 | - head-node 25 | -------------------------------------------------------------------------------- /doc/images/physical.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencord/maas/6f6491879619cc5d55ac0ee0dc8ee911d3b62832/doc/images/physical.graffle -------------------------------------------------------------------------------- /doc/images/physical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencord/maas/6f6491879619cc5d55ac0ee0dc8ee911d3b62832/doc/images/physical.png -------------------------------------------------------------------------------- /doc/images/uservices.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencord/maas/6f6491879619cc5d55ac0ee0dc8ee911d3b62832/doc/images/uservices.graffle -------------------------------------------------------------------------------- /doc/images/uservices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencord/maas/6f6491879619cc5d55ac0ee0dc8ee911d3b62832/doc/images/uservices.png -------------------------------------------------------------------------------- /fabric.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: switches 18 | roles: 19 | - fabric-switch 20 | -------------------------------------------------------------------------------- /group_vars/all: -------------------------------------------------------------------------------- 1 | --- 2 | # file: group_vars/all 3 | ansible_ssh_common_args: "-o ConnectionAttempts=20" -------------------------------------------------------------------------------- /harvester/Makefile: -------------------------------------------------------------------------------- 1 | IMAGES+=harvester 2 | 3 | harvester.image: Dockerfile.harvester *.go vendor/vendor.json 4 | 5 | include ../rules.mk 6 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/gorilla/mux/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Kelsey Hightower kelsey.hightower@gmail.com github.com/kelseyhightower 2 | Travis Parker travis.parker@gmail.com github.com/teepark 3 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /harvester/vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/icmp/helper.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package icmp 6 | 7 | import ( 8 | "encoding/binary" 9 | "unsafe" 10 | ) 11 | 12 | var ( 13 | // See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html. 14 | freebsdVersion uint32 15 | 16 | nativeEndian binary.ByteOrder 17 | ) 18 | 19 | func init() { 20 | i := uint32(1) 21 | b := (*[4]byte)(unsafe.Pointer(&i)) 22 | if b[0] == 1 { 23 | nativeEndian = binary.LittleEndian 24 | } else { 25 | nativeEndian = binary.BigEndian 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/icmp/ipv6.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package icmp 6 | 7 | import ( 8 | "net" 9 | 10 | "golang.org/x/net/internal/iana" 11 | ) 12 | 13 | const ipv6PseudoHeaderLen = 2*net.IPv6len + 8 14 | 15 | // IPv6PseudoHeader returns an IPv6 pseudo header for checksum 16 | // calculation. 17 | func IPv6PseudoHeader(src, dst net.IP) []byte { 18 | b := make([]byte, ipv6PseudoHeaderLen) 19 | copy(b, src.To16()) 20 | copy(b[net.IPv6len:], dst.To16()) 21 | b[len(b)-1] = byte(iana.ProtocolIPv6ICMP) 22 | return b 23 | } 24 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/icmp/sys_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package icmp 6 | 7 | import "syscall" 8 | 9 | func init() { 10 | freebsdVersion, _ = syscall.SysctlUint32("kern.osreldate") 11 | } 12 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/internal/netreflect/socket.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package netreflect implements run-time reflection for the 6 | // facilities of net package. 7 | package netreflect 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | ) 13 | 14 | var ( 15 | errInvalidType = errors.New("invalid type") 16 | errOpNoSupport = errors.New("operation not supported") 17 | ) 18 | 19 | // SocketOf returns the socket descriptor of c. 20 | func SocketOf(c net.Conn) (uintptr, error) { 21 | switch c.(type) { 22 | case *net.TCPConn, *net.UDPConn, *net.IPConn, *net.UnixConn: 23 | return socketOf(c) 24 | default: 25 | return 0, errInvalidType 26 | } 27 | } 28 | 29 | // PacketSocketOf returns the socket descriptor of c. 30 | func PacketSocketOf(c net.PacketConn) (uintptr, error) { 31 | switch c.(type) { 32 | case *net.UDPConn, *net.IPConn, *net.UnixConn: 33 | return socketOf(c.(net.Conn)) 34 | default: 35 | return 0, errInvalidType 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/internal/netreflect/socket_posix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows 6 | 7 | package netreflect 8 | 9 | import ( 10 | "net" 11 | "reflect" 12 | "runtime" 13 | ) 14 | 15 | func socketOf(c net.Conn) (uintptr, error) { 16 | v := reflect.ValueOf(c) 17 | switch e := v.Elem(); e.Kind() { 18 | case reflect.Struct: 19 | fd := e.FieldByName("conn").FieldByName("fd") 20 | switch e := fd.Elem(); e.Kind() { 21 | case reflect.Struct: 22 | sysfd := e.FieldByName("sysfd") 23 | if runtime.GOOS == "windows" { 24 | return uintptr(sysfd.Uint()), nil 25 | } 26 | return uintptr(sysfd.Int()), nil 27 | } 28 | } 29 | return 0, errInvalidType 30 | } 31 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/internal/netreflect/socket_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package netreflect 8 | 9 | import "net" 10 | 11 | func socketOf(c net.Conn) (uintptr, error) { return 0, errOpNoSupport } 12 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/bpfopt_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "os" 9 | "unsafe" 10 | 11 | "golang.org/x/net/bpf" 12 | "golang.org/x/net/internal/netreflect" 13 | ) 14 | 15 | // SetBPF attaches a BPF program to the connection. 16 | // 17 | // Only supported on Linux. 18 | func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error { 19 | s, err := netreflect.PacketSocketOf(c.PacketConn) 20 | if err != nil { 21 | return err 22 | } 23 | prog := sockFProg{ 24 | Len: uint16(len(filter)), 25 | Filter: (*sockFilter)(unsafe.Pointer(&filter[0])), 26 | } 27 | return os.NewSyscallError("setsockopt", setsockopt(s, sysSOL_SOCKET, sysSO_ATTACH_FILTER, unsafe.Pointer(&prog), uint32(unsafe.Sizeof(prog)))) 28 | } 29 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/bpfopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv4 8 | 9 | import "golang.org/x/net/bpf" 10 | 11 | // SetBPF attaches a BPF program to the connection. 12 | // 13 | // Only supported on Linux. 14 | func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error { 15 | return errOpNoSupport 16 | } 17 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/control_pktinfo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin linux solaris 6 | 7 | package ipv4 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | 13 | "golang.org/x/net/internal/iana" 14 | ) 15 | 16 | func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { 17 | m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0])) 18 | m.Level = iana.ProtocolIP 19 | m.Type = sysIP_PKTINFO 20 | m.SetLen(syscall.CmsgLen(sizeofInetPktinfo)) 21 | if cm != nil { 22 | pi := (*inetPktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)])) 23 | if ip := cm.Src.To4(); ip != nil { 24 | copy(pi.Spec_dst[:], ip) 25 | } 26 | if cm.IfIndex > 0 { 27 | pi.setIfindex(cm.IfIndex) 28 | } 29 | } 30 | return b[syscall.CmsgSpace(sizeofInetPktinfo):] 31 | } 32 | 33 | func parsePacketInfo(cm *ControlMessage, b []byte) { 34 | pi := (*inetPktinfo)(unsafe.Pointer(&b[0])) 35 | cm.IfIndex = int(pi.Ifindex) 36 | cm.Dst = pi.Addr[:] 37 | } 38 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/control_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv4 8 | 9 | func setControlMessage(s uintptr, opt *rawOpt, cf ControlFlags, on bool) error { 10 | return errOpNoSupport 11 | } 12 | 13 | func newControlMessage(opt *rawOpt) []byte { 14 | return nil 15 | } 16 | 17 | func parseControlMessage(b []byte) (*ControlMessage, error) { 18 | return nil, errOpNoSupport 19 | } 20 | 21 | func marshalControlMessage(cm *ControlMessage) []byte { 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/control_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import "syscall" 8 | 9 | func setControlMessage(s uintptr, opt *rawOpt, cf ControlFlags, on bool) error { 10 | // TODO(mikio): implement this 11 | return syscall.EWINDOWS 12 | } 13 | 14 | func newControlMessage(opt *rawOpt) []byte { 15 | // TODO(mikio): implement this 16 | return nil 17 | } 18 | 19 | func parseControlMessage(b []byte) (*ControlMessage, error) { 20 | // TODO(mikio): implement this 21 | return nil, syscall.EWINDOWS 22 | } 23 | 24 | func marshalControlMessage(cm *ControlMessage) []byte { 25 | // TODO(mikio): implement this 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/genericopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv4 8 | 9 | // TOS returns the type-of-service field value for outgoing packets. 10 | func (c *genericOpt) TOS() (int, error) { 11 | return 0, errOpNoSupport 12 | } 13 | 14 | // SetTOS sets the type-of-service field value for future outgoing 15 | // packets. 16 | func (c *genericOpt) SetTOS(tos int) error { 17 | return errOpNoSupport 18 | } 19 | 20 | // TTL returns the time-to-live field value for outgoing packets. 21 | func (c *genericOpt) TTL() (int, error) { 22 | return 0, errOpNoSupport 23 | } 24 | 25 | // SetTTL sets the time-to-live field value for future outgoing 26 | // packets. 27 | func (c *genericOpt) SetTTL(ttl int) error { 28 | return errOpNoSupport 29 | } 30 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/icmp_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | func (f *icmpFilter) accept(typ ICMPType) { 8 | f.Data &^= 1 << (uint32(typ) & 31) 9 | } 10 | 11 | func (f *icmpFilter) block(typ ICMPType) { 12 | f.Data |= 1 << (uint32(typ) & 31) 13 | } 14 | 15 | func (f *icmpFilter) setAll(block bool) { 16 | if block { 17 | f.Data = 1<<32 - 1 18 | } else { 19 | f.Data = 0 20 | } 21 | } 22 | 23 | func (f *icmpFilter) willBlock(typ ICMPType) bool { 24 | return f.Data&(1<<(uint32(typ)&31)) != 0 25 | } 26 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/icmp_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv4 8 | 9 | const sizeofICMPFilter = 0x0 10 | 11 | type icmpFilter struct { 12 | } 13 | 14 | func (f *icmpFilter) accept(typ ICMPType) { 15 | } 16 | 17 | func (f *icmpFilter) block(typ ICMPType) { 18 | } 19 | 20 | func (f *icmpFilter) setAll(block bool) { 21 | } 22 | 23 | func (f *icmpFilter) willBlock(typ ICMPType) bool { 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/payload.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import "net" 8 | 9 | // BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo 10 | // methods of PacketConn is not implemented. 11 | 12 | // A payloadHandler represents the IPv4 datagram payload handler. 13 | type payloadHandler struct { 14 | net.PacketConn 15 | rawOpt 16 | } 17 | 18 | func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil } 19 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/sockopt_asmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv4 8 | 9 | import "net" 10 | 11 | func setsockoptIPMreq(s uintptr, name int, ifi *net.Interface, grp net.IP) error { 12 | return errOpNoSupport 13 | } 14 | 15 | func getsockoptInterface(s uintptr, name int) (*net.Interface, error) { 16 | return nil, errOpNoSupport 17 | } 18 | 19 | func setsockoptInterface(s uintptr, name int, ifi *net.Interface) error { 20 | return errOpNoSupport 21 | } 22 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/sockopt_asmreqn_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux 6 | 7 | package ipv4 8 | 9 | import "net" 10 | 11 | func getsockoptIPMreqn(s uintptr, name int) (*net.Interface, error) { 12 | return nil, errOpNoSupport 13 | } 14 | 15 | func setsockoptIPMreqn(s uintptr, name int, ifi *net.Interface, grp net.IP) error { 16 | return errOpNoSupport 17 | } 18 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/sockopt_ssmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux,!solaris 6 | 7 | package ipv4 8 | 9 | import "net" 10 | 11 | func setsockoptGroupReq(s uintptr, name int, ifi *net.Interface, grp net.IP) error { 12 | return errOpNoSupport 13 | } 14 | 15 | func setsockoptGroupSourceReq(s uintptr, name int, ifi *net.Interface, grp, src net.IP) error { 16 | return errOpNoSupport 17 | } 18 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/sockopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv4 8 | 9 | func setInt(s uintptr, opt *sockOpt, v int) error { 10 | return errOpNoSupport 11 | } 12 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/sys_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·socketcall(SB),NOSPLIT,$0-36 8 | JMP syscall·socketcall(SB) 9 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/sys_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 8 | JMP syscall·sysvicall6(SB) 9 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/sys_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv4 8 | 9 | var ( 10 | ctlOpts = [ctlMax]ctlOpt{} 11 | 12 | sockOpts = [ssoMax]sockOpt{} 13 | ) 14 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/syscall_linux_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | const ( 13 | sysGETSOCKOPT = 0xf 14 | sysSETSOCKOPT = 0xe 15 | ) 16 | 17 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) 18 | 19 | func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error { 20 | if _, errno := socketcall(sysGETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { 21 | return error(errno) 22 | } 23 | return nil 24 | } 25 | 26 | func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error { 27 | if _, errno := socketcall(sysSETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { 28 | return error(errno) 29 | } 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/syscall_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux,!386 netbsd openbsd 6 | 7 | package ipv4 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error { 15 | if _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { 16 | return error(errno) 17 | } 18 | return nil 19 | } 20 | 21 | func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error { 22 | if _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { 23 | return error(errno) 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/syscall_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error { 13 | return syscall.Getsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(v), (*int32)(unsafe.Pointer(l))) 14 | } 15 | 16 | func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error { 17 | return syscall.Setsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(v), int32(l)) 18 | } 19 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_dragonfly.go 3 | 4 | package ipv4 5 | 6 | const ( 7 | sysIP_OPTIONS = 0x1 8 | sysIP_HDRINCL = 0x2 9 | sysIP_TOS = 0x3 10 | sysIP_TTL = 0x4 11 | sysIP_RECVOPTS = 0x5 12 | sysIP_RECVRETOPTS = 0x6 13 | sysIP_RECVDSTADDR = 0x7 14 | sysIP_RETOPTS = 0x8 15 | sysIP_RECVIF = 0x14 16 | sysIP_RECVTTL = 0x41 17 | 18 | sysIP_MULTICAST_IF = 0x9 19 | sysIP_MULTICAST_TTL = 0xa 20 | sysIP_MULTICAST_LOOP = 0xb 21 | sysIP_MULTICAST_VIF = 0xe 22 | sysIP_ADD_MEMBERSHIP = 0xc 23 | sysIP_DROP_MEMBERSHIP = 0xd 24 | 25 | sizeofIPMreq = 0x8 26 | ) 27 | 28 | type ipMreq struct { 29 | Multiaddr [4]byte /* in_addr */ 30 | Interface [4]byte /* in_addr */ 31 | } 32 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/zsys_netbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package ipv4 5 | 6 | const ( 7 | sysIP_OPTIONS = 0x1 8 | sysIP_HDRINCL = 0x2 9 | sysIP_TOS = 0x3 10 | sysIP_TTL = 0x4 11 | sysIP_RECVOPTS = 0x5 12 | sysIP_RECVRETOPTS = 0x6 13 | sysIP_RECVDSTADDR = 0x7 14 | sysIP_RETOPTS = 0x8 15 | sysIP_RECVIF = 0x14 16 | sysIP_RECVTTL = 0x17 17 | 18 | sysIP_MULTICAST_IF = 0x9 19 | sysIP_MULTICAST_TTL = 0xa 20 | sysIP_MULTICAST_LOOP = 0xb 21 | sysIP_ADD_MEMBERSHIP = 0xc 22 | sysIP_DROP_MEMBERSHIP = 0xd 23 | 24 | sizeofIPMreq = 0x8 25 | ) 26 | 27 | type ipMreq struct { 28 | Multiaddr [4]byte /* in_addr */ 29 | Interface [4]byte /* in_addr */ 30 | } 31 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv4/zsys_openbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package ipv4 5 | 6 | const ( 7 | sysIP_OPTIONS = 0x1 8 | sysIP_HDRINCL = 0x2 9 | sysIP_TOS = 0x3 10 | sysIP_TTL = 0x4 11 | sysIP_RECVOPTS = 0x5 12 | sysIP_RECVRETOPTS = 0x6 13 | sysIP_RECVDSTADDR = 0x7 14 | sysIP_RETOPTS = 0x8 15 | sysIP_RECVIF = 0x1e 16 | sysIP_RECVTTL = 0x1f 17 | 18 | sysIP_MULTICAST_IF = 0x9 19 | sysIP_MULTICAST_TTL = 0xa 20 | sysIP_MULTICAST_LOOP = 0xb 21 | sysIP_ADD_MEMBERSHIP = 0xc 22 | sysIP_DROP_MEMBERSHIP = 0xd 23 | 24 | sizeofIPMreq = 0x8 25 | ) 26 | 27 | type ipMreq struct { 28 | Multiaddr [4]byte /* in_addr */ 29 | Interface [4]byte /* in_addr */ 30 | } 31 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/bpfopt_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "os" 9 | "unsafe" 10 | 11 | "golang.org/x/net/bpf" 12 | "golang.org/x/net/internal/netreflect" 13 | ) 14 | 15 | // SetBPF attaches a BPF program to the connection. 16 | // 17 | // Only supported on Linux. 18 | func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error { 19 | s, err := netreflect.PacketSocketOf(c.PacketConn) 20 | if err != nil { 21 | return err 22 | } 23 | prog := sockFProg{ 24 | Len: uint16(len(filter)), 25 | Filter: (*sockFilter)(unsafe.Pointer(&filter[0])), 26 | } 27 | return os.NewSyscallError("setsockopt", setsockopt(s, sysSOL_SOCKET, sysSO_ATTACH_FILTER, unsafe.Pointer(&prog), uint32(unsafe.Sizeof(prog)))) 28 | } 29 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/bpfopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv6 8 | 9 | import "golang.org/x/net/bpf" 10 | 11 | // SetBPF attaches a BPF program to the connection. 12 | // 13 | // Only supported on Linux. 14 | func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error { 15 | return errOpNoSupport 16 | } 17 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/control_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv6 8 | 9 | func setControlMessage(s uintptr, opt *rawOpt, cf ControlFlags, on bool) error { 10 | return errOpNoSupport 11 | } 12 | 13 | func newControlMessage(opt *rawOpt) (oob []byte) { 14 | return nil 15 | } 16 | 17 | func parseControlMessage(b []byte) (*ControlMessage, error) { 18 | return nil, errOpNoSupport 19 | } 20 | 21 | func marshalControlMessage(cm *ControlMessage) (oob []byte) { 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/control_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import "syscall" 8 | 9 | func setControlMessage(s uintptr, opt *rawOpt, cf ControlFlags, on bool) error { 10 | // TODO(mikio): implement this 11 | return syscall.EWINDOWS 12 | } 13 | 14 | func newControlMessage(opt *rawOpt) (oob []byte) { 15 | // TODO(mikio): implement this 16 | return nil 17 | } 18 | 19 | func parseControlMessage(b []byte) (*ControlMessage, error) { 20 | // TODO(mikio): implement this 21 | return nil, syscall.EWINDOWS 22 | } 23 | 24 | func marshalControlMessage(cm *ControlMessage) (oob []byte) { 25 | // TODO(mikio): implement this 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/genericopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv6 8 | 9 | // TrafficClass returns the traffic class field value for outgoing 10 | // packets. 11 | func (c *genericOpt) TrafficClass() (int, error) { 12 | return 0, errOpNoSupport 13 | } 14 | 15 | // SetTrafficClass sets the traffic class field value for future 16 | // outgoing packets. 17 | func (c *genericOpt) SetTrafficClass(tclass int) error { 18 | return errOpNoSupport 19 | } 20 | 21 | // HopLimit returns the hop limit field value for outgoing packets. 22 | func (c *genericOpt) HopLimit() (int, error) { 23 | return 0, errOpNoSupport 24 | } 25 | 26 | // SetHopLimit sets the hop limit field value for future outgoing 27 | // packets. 28 | func (c *genericOpt) SetHopLimit(hoplim int) error { 29 | return errOpNoSupport 30 | } 31 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/icmp_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package ipv6 8 | 9 | func (f *icmpv6Filter) accept(typ ICMPType) { 10 | f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) 11 | } 12 | 13 | func (f *icmpv6Filter) block(typ ICMPType) { 14 | f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) 15 | } 16 | 17 | func (f *icmpv6Filter) setAll(block bool) { 18 | for i := range f.Filt { 19 | if block { 20 | f.Filt[i] = 0 21 | } else { 22 | f.Filt[i] = 1<<32 - 1 23 | } 24 | } 25 | } 26 | 27 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 28 | return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 29 | } 30 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/icmp_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | func (f *icmpv6Filter) accept(typ ICMPType) { 8 | f.Data[typ>>5] &^= 1 << (uint32(typ) & 31) 9 | } 10 | 11 | func (f *icmpv6Filter) block(typ ICMPType) { 12 | f.Data[typ>>5] |= 1 << (uint32(typ) & 31) 13 | } 14 | 15 | func (f *icmpv6Filter) setAll(block bool) { 16 | for i := range f.Data { 17 | if block { 18 | f.Data[i] = 1<<32 - 1 19 | } else { 20 | f.Data[i] = 0 21 | } 22 | } 23 | } 24 | 25 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 26 | return f.Data[typ>>5]&(1<<(uint32(typ)&31)) != 0 27 | } 28 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/icmp_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | func (f *icmpv6Filter) accept(typ ICMPType) { 8 | f.X__icmp6_filt[typ>>5] |= 1 << (uint32(typ) & 31) 9 | } 10 | 11 | func (f *icmpv6Filter) block(typ ICMPType) { 12 | f.X__icmp6_filt[typ>>5] &^= 1 << (uint32(typ) & 31) 13 | } 14 | 15 | func (f *icmpv6Filter) setAll(block bool) { 16 | for i := range f.X__icmp6_filt { 17 | if block { 18 | f.X__icmp6_filt[i] = 0 19 | } else { 20 | f.X__icmp6_filt[i] = 1<<32 - 1 21 | } 22 | } 23 | } 24 | 25 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 26 | return f.X__icmp6_filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 27 | } 28 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/icmp_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv6 8 | 9 | type icmpv6Filter struct { 10 | } 11 | 12 | func (f *icmpv6Filter) accept(typ ICMPType) { 13 | } 14 | 15 | func (f *icmpv6Filter) block(typ ICMPType) { 16 | } 17 | 18 | func (f *icmpv6Filter) setAll(block bool) { 19 | } 20 | 21 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/icmp_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | func (f *icmpv6Filter) accept(typ ICMPType) { 8 | // TODO(mikio): implement this 9 | } 10 | 11 | func (f *icmpv6Filter) block(typ ICMPType) { 12 | // TODO(mikio): implement this 13 | } 14 | 15 | func (f *icmpv6Filter) setAll(block bool) { 16 | // TODO(mikio): implement this 17 | } 18 | 19 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 20 | // TODO(mikio): implement this 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/payload.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import "net" 8 | 9 | // BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo 10 | // methods of PacketConn is not implemented. 11 | 12 | // A payloadHandler represents the IPv6 datagram payload handler. 13 | type payloadHandler struct { 14 | net.PacketConn 15 | rawOpt 16 | } 17 | 18 | func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil } 19 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/sockopt_asmreq_posix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | "os" 12 | "unsafe" 13 | ) 14 | 15 | func setsockoptIPMreq(s uintptr, opt *sockOpt, ifi *net.Interface, grp net.IP) error { 16 | var mreq ipv6Mreq 17 | copy(mreq.Multiaddr[:], grp) 18 | if ifi != nil { 19 | mreq.setIfindex(ifi.Index) 20 | } 21 | return os.NewSyscallError("setsockopt", setsockopt(s, opt.level, opt.name, unsafe.Pointer(&mreq), sizeofIPv6Mreq)) 22 | } 23 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/sockopt_ssmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux,!solaris 6 | 7 | package ipv6 8 | 9 | import "net" 10 | 11 | func setsockoptGroupReq(s uintptr, opt *sockOpt, ifi *net.Interface, grp net.IP) error { 12 | return errOpNoSupport 13 | } 14 | 15 | func setsockoptGroupSourceReq(s uintptr, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error { 16 | return errOpNoSupport 17 | } 18 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/sockopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv6 8 | 9 | import "net" 10 | 11 | func getMTUInfo(s uintptr, opt *sockOpt) (*net.Interface, int, error) { 12 | return nil, 0, errOpNoSupport 13 | } 14 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/sys_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·socketcall(SB),NOSPLIT,$0-36 8 | JMP syscall·socketcall(SB) 9 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/sys_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 8 | JMP syscall·sysvicall6(SB) 9 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/sys_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build nacl plan9 6 | 7 | package ipv6 8 | 9 | var ( 10 | ctlOpts = [ctlMax]ctlOpt{} 11 | 12 | sockOpts = [ssoMax]sockOpt{} 13 | ) 14 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/syscall_linux_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | const ( 13 | sysGETSOCKOPT = 0xf 14 | sysSETSOCKOPT = 0xe 15 | ) 16 | 17 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) 18 | 19 | func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error { 20 | if _, errno := socketcall(sysGETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { 21 | return error(errno) 22 | } 23 | return nil 24 | } 25 | 26 | func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error { 27 | if _, errno := socketcall(sysSETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { 28 | return error(errno) 29 | } 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/syscall_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux,!386 netbsd openbsd 6 | 7 | package ipv6 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error { 15 | if _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { 16 | return error(errno) 17 | } 18 | return nil 19 | } 20 | 21 | func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error { 22 | if _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { 23 | return error(errno) 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /harvester/vendor/golang.org/x/net/ipv6/syscall_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error { 13 | return syscall.Getsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(v), (*int32)(unsafe.Pointer(l))) 14 | } 15 | 16 | func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error { 17 | return syscall.Setsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(v), int32(l)) 18 | } 19 | -------------------------------------------------------------------------------- /head-node.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | # install MaaS on head node 19 | 20 | - name: run setup to gather facts 21 | hosts: all, localhost 22 | tasks: 23 | - name: run setup 24 | setup: 25 | 26 | - name: Install MaaS and supporting files on head node 27 | hosts: head 28 | roles: 29 | - head-node 30 | - registry 31 | 32 | -------------------------------------------------------------------------------- /head.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | - hosts: head 18 | roles: 19 | - maas 20 | -------------------------------------------------------------------------------- /help.mk: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := help 2 | 3 | help: 4 | @echo "Available targets:" 5 | @echo " build - builds any artifacts" 6 | @echo " publish - publishes any built artifacts to a deployment server" 7 | @echo " clean - remove tempory files and build artifacts" 8 | @echo " test - executes any unit tests on the project" 9 | @echo " help - this message" 10 | @echo "" 11 | @echo "Available environment variables:" 12 | @echo " PROJECT_PREFIX - defines a prefix to prepend to all Docker image names" 13 | @echo " PACKAGE_TAG - defines the TAG to use on the public Docker image that is the build artifact" 14 | @echo " REGISTRY - name of the registry to which to publish Docker images" 15 | @echo " DOCKER_ARGS - additional arguments to pass to the Docker build command" 16 | -------------------------------------------------------------------------------- /host_vars/cord-r6-s1: -------------------------------------------------------------------------------- 1 | fabric_ip: 10.6.1.1/24 2 | -------------------------------------------------------------------------------- /host_vars/cord-r6-s2: -------------------------------------------------------------------------------- 1 | fabric_ip: 10.6.1.2/24 2 | -------------------------------------------------------------------------------- /host_vars/cord-r6-s3: -------------------------------------------------------------------------------- 1 | fabric_ip: 10.6.2.3/24 2 | -------------------------------------------------------------------------------- /host_vars/cord-r6-s4: -------------------------------------------------------------------------------- 1 | fabric_ip: 10.6.2.4/24 2 | -------------------------------------------------------------------------------- /hosts: -------------------------------------------------------------------------------- 1 | [switches] 2 | spine-1 3 | spine-2 4 | leaf-1 5 | leaf-2 6 | 7 | [head] 8 | 172.42.42.42 9 | 10 | [compute] 11 | 12 | [all:vars] 13 | ansible_ssh_user=ubuntu 14 | 15 | [switches:vars] 16 | ansible_ssh_user=root 17 | -------------------------------------------------------------------------------- /ip-allocator/Makefile: -------------------------------------------------------------------------------- 1 | IMAGES+=allocator 2 | 3 | allocator.image: Dockerfile.allocator *.go vendor/vendor.json 4 | 5 | include ../rules.mk 6 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/gorilla/mux/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Kelsey Hightower kelsey.hightower@gmail.com github.com/kelseyhightower 2 | Travis Parker travis.parker@gmail.com github.com/teepark 3 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /ip-allocator/vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /ip-allocator/vendor/vendor.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": "", 3 | "ignore": "test", 4 | "package": [ 5 | { 6 | "checksumSHA1": "dGXnnR7ZhsrZNnEqFimk6q7YCqs=", 7 | "path": "github.com/Sirupsen/logrus", 8 | "revision": "61e43dc76f7ee59a82bdf3d71033dc12bea4c77d", 9 | "revisionTime": "2017-01-13T01:19:11Z" 10 | }, 11 | { 12 | "checksumSHA1": "F5dR3/i70EhSIMZfeIV+H8/PtvM=", 13 | "path": "github.com/gorilla/mux", 14 | "revision": "392c28fe23e1c45ddba891b0320b3b5df220beea", 15 | "revisionTime": "2017-01-18T13:43:44Z" 16 | }, 17 | { 18 | "checksumSHA1": "pNria08/hqW7nnWb0erRBMdJU3M=", 19 | "path": "github.com/kelseyhightower/envconfig", 20 | "revision": "4069f29f08928c54bcb1fdf632b31b1bb54b4fdb", 21 | "revisionTime": "2017-01-13T19:16:37Z" 22 | } 23 | ], 24 | "rootPath": "gerrit.opencord.org/maas/cord-ip-allocator" 25 | } 26 | -------------------------------------------------------------------------------- /prime-node.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | # install docker and docker registry on head node 19 | 20 | - name: run setup to gather facts 21 | hosts: all, localhost 22 | tasks: 23 | - name: run setup 24 | setup: 25 | 26 | - name: install docker registry 27 | hosts: head 28 | roles: 29 | - registry 30 | 31 | - name: install local SSH key on head node 32 | hosts: head 33 | roles: 34 | - ssh-key 35 | -------------------------------------------------------------------------------- /provisioner/Makefile: -------------------------------------------------------------------------------- 1 | IMAGES+=provisioner 2 | 3 | provisioner.image: ssh-config ansible.cfg Dockerfile.provisioner *.go vendor/vendor.json 4 | 5 | include ../rules.mk 6 | -------------------------------------------------------------------------------- /provisioner/ansible.cfg: -------------------------------------------------------------------------------- 1 | [ssh_connection] 2 | # Turn off connection sharing to prevent zombie processes from hanging around. 3 | # "Just look at the flowers" 4 | ssh_args = -C 5 | -------------------------------------------------------------------------------- /provisioner/ssh-config: -------------------------------------------------------------------------------- 1 | Host * 2 | StrictHostKeyChecking no 3 | UserKnownHostsFile=/dev/null 4 | -------------------------------------------------------------------------------- /provisioner/task.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Open Networking Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | package main 15 | 16 | type TaskStatus uint8 17 | 18 | const ( 19 | Pending TaskStatus = iota 20 | Running 21 | Complete 22 | Failed 23 | ) 24 | 25 | func (s TaskStatus) String() string { 26 | switch s { 27 | case Pending: 28 | return "PENDING" 29 | case Running: 30 | return "RUNNING" 31 | case Complete: 32 | return "COMPLETE" 33 | case Failed: 34 | return "FAILED" 35 | } 36 | return "INVALID TASK STATUS" 37 | } 38 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/gorilla/mux/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/hashicorp/consul/api/README.md: -------------------------------------------------------------------------------- 1 | Consul API client 2 | ================= 3 | 4 | This package provides the `api` package which attempts to 5 | provide programmatic access to the full Consul API. 6 | 7 | Currently, all of the Consul APIs included in version 0.6.0 are supported. 8 | 9 | Documentation 10 | ============= 11 | 12 | The full documentation is available on [Godoc](https://godoc.org/github.com/hashicorp/consul/api) 13 | 14 | Usage 15 | ===== 16 | 17 | Below is an example of using the Consul client: 18 | 19 | ```go 20 | // Get a new client 21 | client, err := api.NewClient(api.DefaultConfig()) 22 | if err != nil { 23 | panic(err) 24 | } 25 | 26 | // Get a handle to the KV API 27 | kv := client.KV() 28 | 29 | // PUT a new KV pair 30 | p := &api.KVPair{Key: "foo", Value: []byte("test")} 31 | _, err = kv.Put(p, nil) 32 | if err != nil { 33 | panic(err) 34 | } 35 | 36 | // Lookup the pair 37 | pair, _, err := kv.Get("foo", nil) 38 | if err != nil { 39 | panic(err) 40 | } 41 | fmt.Printf("KV: %v", pair) 42 | 43 | ``` 44 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/hashicorp/consul/api/raw.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Raw can be used to do raw queries against custom endpoints 4 | type Raw struct { 5 | c *Client 6 | } 7 | 8 | // Raw returns a handle to query endpoints 9 | func (c *Client) Raw() *Raw { 10 | return &Raw{c} 11 | } 12 | 13 | // Query is used to do a GET request against an endpoint 14 | // and deserialize the response into an interface using 15 | // standard Consul conventions. 16 | func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) { 17 | return raw.c.query(endpoint, out, q) 18 | } 19 | 20 | // Write is used to do a PUT request against an endpoint 21 | // and serialize/deserialized using the standard Consul conventions. 22 | func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) { 23 | return raw.c.write(endpoint, in, out, q) 24 | } 25 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Kelsey Hightower kelsey.hightower@gmail.com github.com/kelseyhightower 2 | Travis Parker travis.parker@gmail.com github.com/teepark 3 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /provisioner/vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /roles/ansible/meta/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | galaxy_info: 19 | author: Ciena Blueplanet 20 | description: Ability to excute Ansible Playbooks 21 | company: Ciena Blueplanet 22 | license: Apache 2.0 23 | min_ansible_version: 2.0 24 | platforms: 25 | - name: Ubuntu 26 | versions: 27 | - trusty 28 | galaxy_tags: 29 | - cord 30 | dependencies: [] 31 | -------------------------------------------------------------------------------- /roles/compute-node/files/99-cord-sudoers: -------------------------------------------------------------------------------- 1 | ubuntu ALL=(ALL:ALL) NOPASSWD:ALL 2 | -------------------------------------------------------------------------------- /roles/compute-node/files/config: -------------------------------------------------------------------------------- 1 | Host * 2 | StrictHostKeyChecking no 3 | UserKnownHostsFile=/dev/null 4 | -------------------------------------------------------------------------------- /roles/compute-node/files/delete-fabric-config: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CFG=${1:-"config-tibit.json"} 4 | 5 | curl -v -XDELETE -H Content-Type: application/json http://karaf:karaf@onos-fabric:8181/onos/v1/network/configuration 6 | -------------------------------------------------------------------------------- /roles/compute-node/files/delete-node-prov-state: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIST=$(curl -sS http://$(docker-ip provisioner):4243/provision/ | jq . | grep "node-" | awk '{print $2}' | sed -e 's/[",]//g') 4 | 5 | for i in $LIST; do 6 | echo "DELETE PROV RECORD '$i'" 7 | curl -sS -XDELETE http://$(docker-ip provisioner):4243/provision/$i 8 | done 9 | 10 | -------------------------------------------------------------------------------- /roles/compute-node/files/docker-ip: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | test $# -ne 1 && echo "must specify the name of a container" && exit 1 4 | 5 | IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $1) 6 | 7 | if [ "$IP x" == " x" ]; then 8 | IP=$(docker inspect --format '{{.NetworkSettings.Networks.maas_default.IPAddress}}' $1) 9 | fi 10 | 11 | /bin/echo -ne $IP 12 | -------------------------------------------------------------------------------- /roles/compute-node/files/get-fabric-config: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | curl -sS -H Content-Type: application/json http://karaf:karaf@onos-fabric:8181/onos/v1/network/configuration 4 | -------------------------------------------------------------------------------- /roles/compute-node/files/get-node-prov-state: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | curl -sS http://$(docker-ip provisioner):4243/provision/ | jq '[.[] | { "id": .request.Info.id, "message": .message, "status": .status, "name": .request.Info.name}]' $* 4 | -------------------------------------------------------------------------------- /roles/compute-node/files/i40e-1.4.25.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencord/maas/6f6491879619cc5d55ac0ee0dc8ee911d3b62832/roles/compute-node/files/i40e-1.4.25.tar.gz -------------------------------------------------------------------------------- /roles/compute-node/files/post-fabric-config: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CFG=${1:-"config-tibit.json"} 4 | 5 | curl -v -XPOST -H Content-Type: application/json http://karaf:karaf@onos-fabric:8181/onos/v1/network/configuration -d @$CFG 6 | -------------------------------------------------------------------------------- /roles/compute-node/files/pull-latest-docker-images: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for i in $(docker images --format '{{.Repository}}:{{.Tag}}' | grep docker-registry | grep -v "" | sort); do 4 | docker pull $i 5 | done 6 | -------------------------------------------------------------------------------- /roles/compute-node/meta/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | galaxy_info: 19 | author: Ciena Blueplanet 20 | description: CORD POD Compute Node Base 21 | company: Ciena Blueplanet 22 | license: Apache 2.0 23 | min_ansible_version: 2.0 24 | platforms: 25 | - name: Ubuntu 26 | versions: 27 | - trusty 28 | galaxy_tags: 29 | - cord 30 | dependencies: 31 | - { role: local-ubuntu-repository, when: ubuntu_apt_repo is defined } 32 | - { role : docker } 33 | -------------------------------------------------------------------------------- /roles/docker/defaults/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | 19 | docker_apt_repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable" 20 | 21 | -------------------------------------------------------------------------------- /roles/docker/handlers/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | - name: Docker Restart 19 | become: yes 20 | service: 21 | name=docker 22 | state=restarted 23 | -------------------------------------------------------------------------------- /roles/fabric-switch/meta/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | galaxy_info: 19 | author: Ciena Blueplanet 20 | description: Openflow Agent and Basic Utils for Fabric Switch 21 | company: Ciena Blueplanet 22 | license: Apache 2.0 23 | min_ansible_version: 2.0 24 | platforms: 25 | - name: Ubuntu 26 | versions: 27 | - trusty 28 | galaxy_tags: 29 | - openflow 30 | dependencies: [] 31 | -------------------------------------------------------------------------------- /roles/fabric-switch/tasks/ofdpa-accton.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | - name: Copy Accton OFDPA Debian Archive 17 | get_url: 18 | url: "{{ platforms.accton_switches.file_url }}" 19 | validate_certs: false 20 | checksum: "{{ platforms.accton_switches.checksum }}" 21 | dest: "{{ deb_tmp_inst_dir }}{{ platforms.accton_switches.file_name }}" 22 | 23 | - name: Install Accton OFDPA 24 | apt: deb="{{ deb_tmp_inst_dir }}{{ platforms.accton_switches.file_name }}" force=true 25 | -------------------------------------------------------------------------------- /roles/fabric-switch/tasks/ofdpa-quanta.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | - name: Copy Quanta OFDPA Debian Archive 17 | get_url: 18 | url: "{{ platforms.quanta_switches.file_url }}" 19 | validate_certs: false 20 | checksum: "{{ platforms.quanta_switches.checksum }}" 21 | dest: "{{ deb_tmp_inst_dir }}{{ platforms.quanta_switches.file_name }}" 22 | 23 | - name: Install Quanta OFDPA 24 | apt: deb="{{ deb_tmp_inst_dir }}{{ platforms.quanta_switches.file_name }}" force=true 25 | -------------------------------------------------------------------------------- /roles/fabric-switch/templates/connect: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BG=0 4 | 5 | while [ $# -gt 0 ]; do 6 | case $1 in 7 | -bg|-background) 8 | BG=1 9 | esac 10 | shift 11 | done 12 | 13 | IP=$(ping -c 1 {{ controller_ip }} 2>/dev/null | grep PING | awk '{print $3}' | sed -e 's/[\(\)]//g') 14 | while [ "$IP x" == " x" ]; do 15 | echo "Waiting for controller to resolve ({{ controller_ip }}) ... sleeping 5s and will try again ..." 16 | sleep 5 17 | IP=$(ping -c 1 {{ controller_ip }} 2>/dev/null | grep PING | awk '{print $3}' | sed -e 's/[\(\)]//g') 18 | done 19 | 20 | if [ $BG -eq 1 ]; then 21 | nohup launcher ofagentapp -i {{ switch_id }} -t $IP 2>&1 > connect.log & 22 | else 23 | launcher ofagentapp -i {{ switch_id }} -t $IP 24 | fi 25 | -------------------------------------------------------------------------------- /roles/fabric-switch/templates/killit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | killall ofagentapp 4 | -------------------------------------------------------------------------------- /roles/head-node/defaults/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | maas: 18 | user: "{{ maas_user | default('cord') }}" 19 | -------------------------------------------------------------------------------- /roles/head-node/files/commands/cord-generate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #D provides access to the CORD POD fabric configuration generation 3 | 4 | PROG=$(echo $(basename $0) | sed -e 's/^cord-/cord /g') 5 | 6 | usage() { 7 | echo "usage: $PROG [options]" 8 | echo " -hc|--host-count number of hosts to expect to find in ONOS" 9 | echo " -sc|--switch-count number of switches to expect to find in ONOS" 10 | echo " -h|--help this message" 11 | } 12 | 13 | HOST_COUNT=0 14 | SWITCH_COUNT=0 15 | 16 | while [ $# -gt 0 ]; do 17 | case $1 in 18 | -hc|--host-count) 19 | shift 20 | HOST_COUNT=$1 21 | ;; 22 | -sc|--switch-count) 23 | shift 24 | SWITCH_COUNT=$1 25 | ;; 26 | -h|--help) 27 | usage 28 | exit 0 29 | ;; 30 | esac 31 | shift 32 | done 33 | 34 | exec curl --fail -sSL -XPOST http://$CORD_HEAD_NODE:4245/config/ -d "{\"hostcount\":$HOST_COUNT,\"switchcount\":$SWITCH_COUNT}" 35 | -------------------------------------------------------------------------------- /roles/head-node/files/do-ansible: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | 3 | ID=$1 4 | HOSTNAME=$2 5 | IP=$3 6 | MAC=$4 7 | ROLE=$5 8 | 9 | LOG=/etc/maas/ansible/logs/$ID.log 10 | 11 | echo "" >> $LOG 12 | echo "***** BEGIN *****" >> $LOG 13 | echo "PROVISION $ID $HOSTNAME $IP $MAC $ROLE" >> $LOG 14 | 15 | SKIP_TAGS= 16 | EXTRA_VARS= 17 | if [ "$INTERFACE_CONFIG" -eq 1 ]; then 18 | FAB_IP="$(curl -s http://allocator:4242/allocations/$MAC | sed -e 's/[{}"]//g' | cut -d, -f2 | cut -d: -f2)/24" 19 | EXTRA_VARS="--extra-vars=fabric_ip=$FAB_IP" 20 | else 21 | SKIP_TAGS="--skip-tags=interface_config" 22 | fi 23 | 24 | echo "ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook --private-key=/etc/maas/ansible/id_rsa -i $HOSTNAME, /etc/maas/ansible/compute-node.yml $SKIP_TAGS $EXTRA_VARS" >> $LOG 25 | ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook --private-key=/etc/maas/ansible/id_rsa -i $HOSTNAME, /etc/maas/ansible/compute-node.yml $SKIP_TAGS $EXTRA_VARS >> $LOG || exit $? 26 | -------------------------------------------------------------------------------- /roles/head-node/files/do-switch: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | 3 | ID=$1 4 | HOSTNAME=$2 5 | IP=$3 6 | MAC=$4 7 | ROLE=$5 8 | 9 | LOG=/etc/maas/ansible/logs/$ID.log 10 | 11 | echo "" >> $LOG 12 | echo "***** BEGIN *****" >> $LOG 13 | echo "PROVISION $ID $HOSTNAME $IP $MAC $ROLE" >> $LOG 14 | 15 | SKIP_TAGS= 16 | EXTRA_VARS=--extra-vars=ansible_ssh_pass=onl 17 | 18 | echo "ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook -i $IP, /etc/maas/ansible/switch-node.yml $SKIP_TAGS $EXTRA_VARS" >> $LOG 19 | ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook -i $IP, /etc/maas/ansible/switch-node.yml $SKIP_TAGS $EXTRA_VARS >> $LOG 20 | 21 | -------------------------------------------------------------------------------- /roles/head-node/meta/main.yml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2017-present Open Networking Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | --- 18 | galaxy_info: 19 | author: Ciena Blueplanet 20 | description: Services Required By Head Node to Provisioning Compute Nodes 21 | company: Ciena Blueplanet 22 | license: Apache 2.0 23 | min_ansible_version: 2.0 24 | platforms: 25 | - name: Ubuntu 26 | versions: 27 | - trusty 28 | galaxy_tags: 29 | - cord 30 | dependencies: 31 | - { role : maas } 32 | - { role : ansible } 33 | -------------------------------------------------------------------------------- /roles/head-node/templates/compute-node.yml.j2: -------------------------------------------------------------------------------- 1 | 2 | {# 3 | Copyright 2017-present Open Networking Foundation 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | #} 17 | 18 | 19 | --- 20 | - name: Include vars 21 | hosts: all 22 | remote_user: ubuntu 23 | tasks: 24 | - name: Include variables 25 | include_vars: vars/compute-node-vars.yml 26 | 27 | - name: Configure compute hosts to use DNS server 28 | hosts: all 29 | remote_user: ubuntu 30 | roles: 31 | - role: compute-node 32 | -------------------------------------------------------------------------------- /roles/head-node/templates/pod-inventory: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | maas login cord http://localhost/MAAS/api/1.0 '{{ apikey.stdout }}' > /dev/null 4 | NODES=$(maas cord nodes list | jq '.[].hostname' | sed -e 's/"//g') 5 | maas logout cord 6 | 7 | cat < README.md 11 | sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/ansiterm?status.svg)](https://godoc.org/github.com/juju/ansiterm)|' README.md 12 | 13 | 14 | .PHONY: default check docs 15 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/ansiterm/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | // Package ansiterm provides a Writer that writes out the ANSI escape 5 | // codes for color and styles. 6 | package ansiterm 7 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/ansiterm/terminal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package ansiterm 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | "github.com/mattn/go-colorable" 11 | "github.com/mattn/go-isatty" 12 | ) 13 | 14 | // colorEnabledWriter returns a writer that can handle the ansi color codes 15 | // and true if the writer passed in is a terminal capable of color. If the 16 | // TERM environment variable is set to "dumb", the terminal is not considered 17 | // color capable. 18 | func colorEnabledWriter(w io.Writer) (io.Writer, bool) { 19 | f, ok := w.(*os.File) 20 | if !ok { 21 | return w, false 22 | } 23 | // Check the TERM environment variable specifically 24 | // to check for "dumb" terminals. 25 | if os.Getenv("TERM") == "dumb" { 26 | return w, false 27 | } 28 | if !isatty.IsTerminal(f.Fd()) { 29 | return w, false 30 | } 31 | return colorable.NewColorable(f), true 32 | } 33 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/errors/Makefile: -------------------------------------------------------------------------------- 1 | default: check 2 | 3 | check: 4 | go test && go test -compiler gccgo 5 | 6 | docs: 7 | godoc2md github.com/juju/errors > README.md 8 | sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors)|' README.md 9 | 10 | 11 | .PHONY: default check docs 12 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/errors/path.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, 2014 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package errors 5 | 6 | import ( 7 | "runtime" 8 | "strings" 9 | ) 10 | 11 | // prefixSize is used internally to trim the user specific path from the 12 | // front of the returned filenames from the runtime call stack. 13 | var prefixSize int 14 | 15 | // goPath is the deduced path based on the location of this file as compiled. 16 | var goPath string 17 | 18 | func init() { 19 | _, file, _, ok := runtime.Caller(0) 20 | if file == "?" { 21 | return 22 | } 23 | if ok { 24 | // We know that the end of the file should be: 25 | // github.com/juju/errors/path.go 26 | size := len(file) 27 | suffix := len("github.com/juju/errors/path.go") 28 | goPath = file[:size-suffix] 29 | prefixSize = len(goPath) 30 | } 31 | } 32 | 33 | func trimGoPath(filename string) string { 34 | if strings.HasPrefix(filename, goPath) { 35 | return filename[prefixSize:] 36 | } 37 | return filename 38 | } 39 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/gomaasapi/Makefile: -------------------------------------------------------------------------------- 1 | # Build, and run tests. 2 | check: examples 3 | go test ./... 4 | 5 | example_source := $(wildcard example/*.go) 6 | example_binaries := $(patsubst %.go,%,$(example_source)) 7 | 8 | # Clean up binaries. 9 | clean: 10 | $(RM) $(example_binaries) 11 | 12 | # Reformat the source files to match our layout standards. 13 | format: 14 | gofmt -w . 15 | 16 | # Invoke gofmt's "simplify" option to streamline the source code. 17 | simplify: 18 | gofmt -w -s . 19 | 20 | # Build the examples (we have no tests for them). 21 | examples: $(example_binaries) 22 | 23 | %: %.go 24 | go build -o $@ $< 25 | 26 | .PHONY: check clean format examples simplify 27 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/gomaasapi/README.rst: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ****************************** 4 | MAAS API client library for Go 5 | ****************************** 6 | 7 | This library serves as a minimal client for communicating with the MAAS web 8 | API in Go programs. 9 | 10 | For more information see the `project homepage`_. 11 | 12 | .. _project homepage: https://github.com/juju/gomaasapi 13 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/gomaasapi/dependencies.tsv: -------------------------------------------------------------------------------- 1 | github.com/juju/errors git 1b5e39b83d1835fa480e0c2ddefb040ee82d58b3 2015-09-16T12:56:42Z 2 | github.com/juju/loggo git 8477fc936adf0e382d680310047ca27e128a309a 2015-05-27T03:58:39Z 3 | github.com/juju/names git 8a0aa0963bbacdc790914892e9ff942e94d6f795 2016-03-30T15:05:33Z 4 | github.com/juju/schema git 075de04f9b7d7580d60a1e12a0b3f50bb18e6998 2016-04-20T04:42:03Z 5 | github.com/juju/testing git 162fafccebf20a4207ab93d63b986c230e3f4d2e 2016-04-04T09:43:17Z 6 | github.com/juju/utils git eb6cb958762135bb61aed1e0951f657c674d427f 2016-04-11T02:40:59Z 7 | github.com/juju/version git ef897ad7f130870348ce306f61332f5335355063 2015-11-27T20:34:00Z 8 | golang.org/x/crypto git aedad9a179ec1ea11b7064c57cbc6dc30d7724ec 2015-08-30T18:06:42Z 9 | gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z 10 | gopkg.in/mgo.v2 git 4d04138ffef2791c479c0c8bbffc30b34081b8d9 2015-10-26T16:34:53Z 11 | gopkg.in/yaml.v2 git a83829b6f1293c91addabc89d0571c246397bbf4 2016-03-01T20:40:22Z 12 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/gomaasapi/gomaasapi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/gomaasapi/maas.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | 6 | // NewMAAS returns an interface to the MAAS API as a *MAASObject. 7 | func NewMAAS(client Client) *MAASObject { 8 | attrs := map[string]interface{}{resourceURI: client.APIURL.String()} 9 | obj := newJSONMAASObject(attrs, client) 10 | return &obj 11 | } 12 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/gomaasapi/testservice_vlan.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | 6 | import ( 7 | "fmt" 8 | "net/http" 9 | ) 10 | 11 | func getVLANsEndpoint(version string) string { 12 | return fmt.Sprintf("/api/%s/vlans/", version) 13 | } 14 | 15 | // TestVLAN is the MAAS API VLAN representation 16 | type TestVLAN struct { 17 | Name string `json:"name"` 18 | Fabric string `json:"fabric"` 19 | VID uint `json:"vid"` 20 | 21 | ResourceURI string `json:"resource_uri"` 22 | ID uint `json:"id"` 23 | } 24 | 25 | // PostedVLAN is the MAAS API posted VLAN representation 26 | type PostedVLAN struct { 27 | Name string `json:"name"` 28 | VID uint `json:"vid"` 29 | } 30 | 31 | func vlansHandler(server *TestServer, w http.ResponseWriter, r *http.Request) { 32 | //TODO 33 | } 34 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/gomaasapi/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package gomaasapi 5 | 6 | import ( 7 | "strings" 8 | ) 9 | 10 | // JoinURLs joins a base URL and a subpath together. 11 | // Regardless of whether baseURL ends in a trailing slash (or even multiple 12 | // trailing slashes), or whether there are any leading slashes at the begining 13 | // of path, the two will always be joined together by a single slash. 14 | func JoinURLs(baseURL, path string) string { 15 | return strings.TrimRight(baseURL, "/") + "/" + strings.TrimLeft(path, "/") 16 | } 17 | 18 | // EnsureTrailingSlash appends a slash at the end of the given string unless 19 | // there already is one. 20 | // This is used to create the kind of normalized URLs that Django expects. 21 | // (to avoid Django's redirection when an URL does not ends with a slash.) 22 | func EnsureTrailingSlash(URL string) string { 23 | if strings.HasSuffix(URL, "/") { 24 | return URL 25 | } 26 | return URL + "/" 27 | } 28 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/loggo/Makefile: -------------------------------------------------------------------------------- 1 | default: check 2 | 3 | check: 4 | go test 5 | 6 | docs: 7 | godoc2md github.com/juju/loggo > README.md 8 | sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/loggo?status.svg)](https://godoc.org/github.com/juju/loggo)|' README.md 9 | 10 | 11 | .PHONY: default check docs 12 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/loggo/dependencies.tsv: -------------------------------------------------------------------------------- 1 | github.com/juju/ansiterm git c368f42cb4b32a70389cded05c7345d9ccdce889 2016-08-17T02:52:20Z 2 | github.com/lunixbochs/vtclean git 4fbf7632a2c6d3fbdb9931439bdbbeded02cbe36 2016-01-25T03:51:06Z 3 | github.com/mattn/go-colorable git ed8eb9e318d7a84ce5915b495b7d35e0cfe7b5a8 2016-07-31T23:54:17Z 4 | github.com/mattn/go-isatty git 66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8 2016-08-06T12:27:52Z 5 | gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z 6 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/loggo/entry.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package loggo 5 | 6 | import "time" 7 | 8 | // Entry represents a single log message. 9 | type Entry struct { 10 | // Level is the severity of the log message. 11 | Level Level 12 | // Module is the dotted module name from the logger. 13 | Module string 14 | // Filename is the full path the file that logged the message. 15 | Filename string 16 | // Line is the line number of the Filename. 17 | Line int 18 | // Timestamp is when the log message was created 19 | Timestamp time.Time 20 | // Message is the formatted string from teh log call. 21 | Message string 22 | } 23 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/schema/README.md: -------------------------------------------------------------------------------- 1 | juju/schema 2 | =========== 3 | 4 | This package provides helpers for coercing dynamically typed data structures 5 | into known forms. 6 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/schema/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package schema 5 | 6 | import ( 7 | "fmt" 8 | ) 9 | 10 | type error_ struct { 11 | want string 12 | got interface{} 13 | path []string 14 | } 15 | 16 | func (e error_) Error() string { 17 | path := pathAsPrefix(e.path) 18 | if e.want == "" { 19 | return fmt.Sprintf("%sunexpected value %#v", path, e.got) 20 | } 21 | if e.got == nil { 22 | return fmt.Sprintf("%sexpected %s, got nothing", path, e.want) 23 | } 24 | return fmt.Sprintf("%sexpected %s, got %T(%#v)", path, e.want, e.got, e.got) 25 | } 26 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/schema/size.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package schema 5 | 6 | import ( 7 | "github.com/juju/utils" 8 | "reflect" 9 | ) 10 | 11 | // Size returns a Checker that accepts a string value, and returns 12 | // the parsed string as a size in mebibytes see: https://godoc.org/github.com/juju/utils#ParseSize 13 | func Size() Checker { 14 | return sizeC{} 15 | } 16 | 17 | type sizeC struct{} 18 | 19 | // Coerce implements Checker Coerce method. 20 | func (c sizeC) Coerce(v interface{}, path []string) (interface{}, error) { 21 | if v == nil { 22 | return nil, error_{"string", v, path} 23 | } 24 | 25 | typeOf := reflect.TypeOf(v).Kind() 26 | if typeOf != reflect.String { 27 | return nil, error_{"string", v, path} 28 | } 29 | 30 | value := reflect.ValueOf(v).String() 31 | if value == "" { 32 | return nil, error_{"empty string", v, path} 33 | } 34 | 35 | v, err := utils.ParseSize(value) 36 | 37 | if err != nil { 38 | return nil, err 39 | } 40 | 41 | return v, nil 42 | } 43 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/Makefile: -------------------------------------------------------------------------------- 1 | PROJECT := github.com/juju/utils 2 | 3 | check-licence: 4 | @(fgrep -rl "Licensed under the LGPLv3" .;\ 5 | fgrep -rl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" .;\ 6 | find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ 7 | xargs -I {} echo FAIL: licence missed: {} 8 | 9 | check: check-licence 10 | go test $(PROJECT)/... -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/README.md: -------------------------------------------------------------------------------- 1 | juju/utils 2 | ============ 3 | 4 | This package provides general utility packages and functions. 5 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/command.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "os/exec" 8 | ) 9 | 10 | // RunCommand executes the command and return the combined output. 11 | func RunCommand(command string, args ...string) (output string, err error) { 12 | cmd := exec.Command(command, args...) 13 | out, err := cmd.CombinedOutput() 14 | output = string(out) 15 | if err != nil { 16 | return output, err 17 | } 18 | return output, nil 19 | } 20 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/gomaxprocs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "os" 8 | "runtime" 9 | ) 10 | 11 | var gomaxprocs = runtime.GOMAXPROCS 12 | var numCPU = runtime.NumCPU 13 | 14 | // UseMultipleCPUs sets GOMAXPROCS to the number of CPU cores unless it has 15 | // already been overridden by the GOMAXPROCS environment variable. 16 | func UseMultipleCPUs() { 17 | if envGOMAXPROCS := os.Getenv("GOMAXPROCS"); envGOMAXPROCS != "" { 18 | n := gomaxprocs(0) 19 | logger.Debugf("GOMAXPROCS already set in environment to %q, %d internally", 20 | envGOMAXPROCS, n) 21 | return 22 | } 23 | n := numCPU() 24 | logger.Debugf("setting GOMAXPROCS to %d", n) 25 | gomaxprocs(n) 26 | } 27 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/home_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | // +build !windows 4 | 5 | package utils 6 | 7 | import ( 8 | "os" 9 | ) 10 | 11 | // Home returns the os-specific home path as specified in the environment. 12 | func Home() string { 13 | return os.Getenv("HOME") 14 | } 15 | 16 | // SetHome sets the os-specific home path in the environment. 17 | func SetHome(s string) error { 18 | return os.Setenv("HOME", s) 19 | } 20 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/home_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "os" 8 | "path/filepath" 9 | ) 10 | 11 | // Home returns the os-specific home path as specified in the environment. 12 | func Home() string { 13 | return filepath.Join(os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH")) 14 | } 15 | 16 | // SetHome sets the os-specific home path in the environment. 17 | func SetHome(s string) error { 18 | v := filepath.VolumeName(s) 19 | if v != "" { 20 | if err := os.Setenv("HOMEDRIVE", v); err != nil { 21 | return err 22 | } 23 | } 24 | return os.Setenv("HOMEPATH", s[len(v):]) 25 | } 26 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/http-1_4.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | //+build !go1.7 5 | 6 | package utils 7 | 8 | import ( 9 | "fmt" 10 | "net" 11 | "net/http" 12 | ) 13 | 14 | // installHTTPDialShim patches the default HTTP transport so 15 | // that it fails when an attempt is made to dial a non-local 16 | // host. 17 | func installHTTPDialShim(t *http.Transport) { 18 | t.Dial = func(network, addr string) (net.Conn, error) { 19 | if !OutgoingAccessAllowed && !isLocalAddr(addr) { 20 | return nil, fmt.Errorf("access to address %q not allowed", addr) 21 | } 22 | return net.Dial(network, addr) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/http-1_7.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | //+build go1.7 5 | 6 | package utils 7 | 8 | import ( 9 | "context" 10 | "fmt" 11 | "net" 12 | "net/http" 13 | "time" 14 | ) 15 | 16 | var ctxtDialer = &net.Dialer{ 17 | Timeout: 30 * time.Second, 18 | KeepAlive: 30 * time.Second, 19 | } 20 | 21 | // installHTTPDialShim patches the default HTTP transport so 22 | // that it fails when an attempt is made to dial a non-local 23 | // host. 24 | // 25 | // Note that this is Go version dependent because in Go 1.7 and above, 26 | // the DialContext field was introduced (and set in http.DefaultTransport) 27 | // which overrides the Dial field. 28 | func installHTTPDialShim(t *http.Transport) { 29 | t.DialContext = func(ctxt context.Context, network, addr string) (net.Conn, error) { 30 | if !OutgoingAccessAllowed && !isLocalAddr(addr) { 31 | return nil, fmt.Errorf("access to address %q not allowed", addr) 32 | } 33 | return ctxtDialer.DialContext(ctxt, network, addr) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/isubuntu.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011, 2012, 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "strings" 8 | ) 9 | 10 | // IsUbuntu executes lxb_release to see if the host OS is Ubuntu. 11 | func IsUbuntu() bool { 12 | out, err := RunCommand("lsb_release", "-i", "-s") 13 | if err != nil { 14 | return false 15 | } 16 | return strings.TrimSpace(out) == "Ubuntu" 17 | } 18 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/os.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | // These are the names of the operating systems recognized by Go. 7 | const ( 8 | OSWindows = "windows" 9 | OSDarwin = "darwin" 10 | OSDragonfly = "dragonfly" 11 | OSFreebsd = "freebsd" 12 | OSLinux = "linux" 13 | OSNacl = "nacl" 14 | OSNetbsd = "netbsd" 15 | OSOpenbsd = "openbsd" 16 | OSSolaris = "solaris" 17 | ) 18 | 19 | // OSUnix is the list of unix-like operating systems recognized by Go. 20 | // See http://golang.org/src/path/filepath/path_unix.go. 21 | var OSUnix = []string{ 22 | OSDarwin, 23 | OSDragonfly, 24 | OSFreebsd, 25 | OSLinux, 26 | OSNacl, 27 | OSNetbsd, 28 | OSOpenbsd, 29 | OSSolaris, 30 | } 31 | 32 | // OSIsUnix determines whether or not the given OS name is one of the 33 | // unix-like operating systems recognized by Go. 34 | func OSIsUnix(os string) bool { 35 | for _, goos := range OSUnix { 36 | if os == goos { 37 | return true 38 | } 39 | } 40 | return false 41 | } 42 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/randomstring.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | package utils 5 | 6 | import ( 7 | "math/rand" 8 | "sync" 9 | "time" 10 | ) 11 | 12 | // Can be used as a sane default argument for RandomString 13 | var ( 14 | LowerAlpha = []rune("abcdefghijklmnopqrstuvwxyz") 15 | UpperAlpha = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ") 16 | Digits = []rune("0123456789") 17 | ) 18 | 19 | var ( 20 | randomStringMu sync.Mutex 21 | randomStringRand *rand.Rand 22 | ) 23 | 24 | func init() { 25 | randomStringRand = rand.New( 26 | rand.NewSource(time.Now().UnixNano()), 27 | ) 28 | } 29 | 30 | // RandomString will return a string of length n that will only 31 | // contain runes inside validRunes 32 | func RandomString(n int, validRunes []rune) string { 33 | randomStringMu.Lock() 34 | defer randomStringMu.Unlock() 35 | 36 | runes := make([]rune, n) 37 | for i := range runes { 38 | runes[i] = validRunes[randomStringRand.Intn(len(validRunes))] 39 | } 40 | 41 | return string(runes) 42 | } 43 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/systemerrmessages_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Canonical Ltd. 2 | // Copyright 2014 Cloudbase Solutions SRL 3 | // Licensed under the LGPLv3, see LICENCE file for details. 4 | 5 | // +build !windows 6 | 7 | package utils 8 | 9 | // The following are strings/regex-es which match common Unix error messages 10 | // that may be returned in case of failed calls to the system. 11 | // Any extra leading/trailing regex-es are left to be added by the developer. 12 | const ( 13 | NoSuchUserErrRegexp = `user: unknown user [a-z0-9_-]*` 14 | NoSuchFileErrRegexp = `no such file or directory` 15 | MkdirFailErrRegexp = `.* not a directory` 16 | ) 17 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/systemerrmessages_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Canonical Ltd. 2 | // Copyright 2014 Cloudbase Solutions SRL 3 | // Licensed under the LGPLv3, see LICENCE file for details. 4 | 5 | package utils 6 | 7 | // The following are strings/regex-es which match common Windows error messages 8 | // that may be returned in case of failed calls to the system. 9 | // Any extra leading/trailing regex-es are left to be added by the developer. 10 | const ( 11 | NoSuchUserErrRegexp = `No mapping between account names and security IDs was done\.` 12 | NoSuchFileErrRegexp = `The system cannot find the (file|path) specified\.` 13 | MkdirFailErrRegexp = `mkdir .*` + NoSuchFileErrRegexp 14 | ) 15 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/utils/zfile_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Canonical Ltd. 2 | // Licensed under the LGPLv3, see LICENCE file for details. 3 | 4 | // mksyscall_windows.pl -l32 file_windows.go 5 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 6 | 7 | package utils 8 | 9 | import "unsafe" 10 | import "syscall" 11 | 12 | var ( 13 | modkernel32 = syscall.NewLazyDLL("kernel32.dll") 14 | 15 | procMoveFileExW = modkernel32.NewProc("MoveFileExW") 16 | ) 17 | 18 | func moveFileEx(lpExistingFileName *uint16, lpNewFileName *uint16, dwFlags uint32) (err error) { 19 | r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(lpExistingFileName)), uintptr(unsafe.Pointer(lpNewFileName)), uintptr(dwFlags)) 20 | if r1 == 0 { 21 | if e1 != 0 { 22 | err = error(e1) 23 | } else { 24 | err = syscall.EINVAL 25 | } 26 | } 27 | return 28 | } 29 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/juju/version/README.md: -------------------------------------------------------------------------------- 1 | # Version [![GoDoc](https://godoc.org/github.com/juju/version?status.svg)](https://godoc.org/github.com/juju/version) 2 | version is a go package for intelligent version comparisons. 3 | 4 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/kelseyhightower/envconfig/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Kelsey Hightower kelsey.hightower@gmail.com github.com/kelseyhightower 2 | Travis Parker travis.parker@gmail.com github.com/teepark 3 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/lunixbochs/vtclean/README.md: -------------------------------------------------------------------------------- 1 | vtclean 2 | ---- 3 | 4 | Clean up raw terminal output by stripping escape sequences, optionally preserving color. 5 | 6 | Get it: `go get github.com/lunixbochs/vtclean/vtclean` 7 | 8 | API: 9 | 10 | import "github.com/lunixbochs/vtclean" 11 | vtclean.Clean(line string, color bool) string 12 | 13 | Command line example: 14 | 15 | $ echo -e '\x1b[1;32mcolor example 16 | color forced to stop at end of line 17 | backspace is ba\b\bgood 18 | no beeps!\x07\x07' | ./vtclean -color 19 | 20 | color example 21 | color forced to stop at end of line 22 | backspace is good 23 | no beeps! 24 | 25 | Go example: 26 | 27 | package main 28 | 29 | import ( 30 | "fmt" 31 | "github.com/lunixbochs/vtclean" 32 | ) 33 | 34 | func main() { 35 | line := vtclean.Clean( 36 | "\033[1;32mcolor, " + 37 | "curs\033[Aor, " + 38 | "backspace\b\b\b\b\b\b\b\b\b\b\b\033[K", false) 39 | fmt.Println(line) 40 | } 41 | 42 | Output: 43 | 44 | color, cursor 45 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/lunixbochs/vtclean/regex.txt: -------------------------------------------------------------------------------- 1 | this is the source definitions for the scary escape code regex 2 | 3 | # from tests in Terminal.app, this regex should cover all basic \e[ and \e] cases 4 | ^([\[\]]([\d\?]+)?(;[\d\?]+)*)?. 5 | 6 | # this catches any case the above does not 7 | # make sure to not include any special characters the main regex finds (like ?) 8 | \[[^a-zA-Z0-9@\?]+. 9 | 10 | # esc + paren + any single char 11 | [\(\)]. 12 | 13 | # didn't re-check this one (not included) 14 | [\[K]\d+;\d+ 15 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | Colorable writer for windows. 4 | 5 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 6 | This package is possible to handle escape sequence for ansi color on windows. 7 | 8 | ## Too Bad! 9 | 10 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 11 | 12 | 13 | ## So Good! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 16 | 17 | ## Usage 18 | 19 | ```go 20 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 21 | logrus.SetOutput(colorable.NewColorableStdout()) 22 | 23 | logrus.Info("succeeded") 24 | logrus.Warn("not correct") 25 | logrus.Error("something error") 26 | logrus.Fatal("panic") 27 | ``` 28 | 29 | You can compile above code on non-windows OSs. 30 | 31 | ## Installation 32 | 33 | ``` 34 | $ go get github.com/mattn/go-colorable 35 | ``` 36 | 37 | # License 38 | 39 | MIT 40 | 41 | # Author 42 | 43 | Yasuhiro Matsumoto (a.k.a mattn) 44 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // NewColorable return new instance of Writer which handle escape sequence. 11 | func NewColorable(file *os.File) io.Writer { 12 | if file == nil { 13 | panic("nil passed instead of *os.File to NewColorable()") 14 | } 15 | 16 | return file 17 | } 18 | 19 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 20 | func NewColorableStdout() io.Writer { 21 | return os.Stdout 22 | } 23 | 24 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 25 | func NewColorableStderr() io.Writer { 26 | return os.Stderr 27 | } 28 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | isatty for golang 4 | 5 | ## Usage 6 | 7 | ```go 8 | package main 9 | 10 | import ( 11 | "fmt" 12 | "github.com/mattn/go-isatty" 13 | "os" 14 | ) 15 | 16 | func main() { 17 | if isatty.IsTerminal(os.Stdout.Fd()) { 18 | fmt.Println("Is Terminal") 19 | } else { 20 | fmt.Println("Is Not Terminal") 21 | } 22 | } 23 | ``` 24 | 25 | ## Installation 26 | 27 | ``` 28 | $ go get github.com/mattn/go-isatty 29 | ``` 30 | 31 | # License 32 | 33 | MIT 34 | 35 | # Author 36 | 37 | Yasuhiro Matsumoto (a.k.a mattn) 38 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /switchq/vendor/github.com/mattn/go-isatty/isatty_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 12 | var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var st uint32 17 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 18 | return r != 0 && e == 0 19 | } 20 | -------------------------------------------------------------------------------- /switchq/vendor/gopkg.in/juju/names.v2/README.md: -------------------------------------------------------------------------------- 1 | juju/names 2 | ============ 3 | 4 | This package provides helpers for handling Juju entity names. 5 | -------------------------------------------------------------------------------- /switchq/vendor/gopkg.in/yaml.v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /switchq/vendors.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "prefix" : "CC:37:AB", 4 | "vendor" : "Edgecore Networks Corporation", 5 | "provision" : true 6 | }, 7 | { 8 | "prefix" : "70:72:CF", 9 | "vendor" : "Edgecore Networks Corporation", 10 | "provision" : true 11 | }, 12 | { 13 | "prefix" : "C4:39:3A", 14 | "vendor" : "Edgecore Networks Corporation", 15 | "provision" : true 16 | }, 17 | { 18 | "prefix" : "8C:EA:1B", 19 | "vendor" : "Edgecore Networks Corporation", 20 | "provision" : true 21 | }, 22 | { 23 | "prefix" : "A8:2B:B5", 24 | "vendor" : "Edgecore Networks Corporation", 25 | "provision" : true 26 | }, 27 | { 28 | "prefix" : "48:0F:CF", 29 | "vendor" : "Hewlett Packard Enterprise", 30 | "provision" : true 31 | }, 32 | { 33 | "prefix" : "54:AB:3A", 34 | "vendor" : "Quanta QCT", 35 | "provision" : true 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /utils/enable-remote-docker-registry: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROG=$(basename $0) 4 | 5 | HELP=$(echo "$*" | grep "\-h" | wc -w) 6 | 7 | if [ $HELP -ne 0 ]; then 8 | echo "usage: $PROG ..." 9 | exit 1 10 | fi 11 | 12 | LINE="DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\"" 13 | 14 | OUT=$(tempfile) 15 | cat /etc/default/docker >> $OUT 16 | CHANGED=0 17 | while [ $# -gt 0 ]; do 18 | FOUND=$(grep "$LINE" /etc/default/docker | wc -l) 19 | if [ $FOUND -eq 0 ]; then 20 | echo "DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\"" >> $OUT 21 | CHANGED=1 22 | fi 23 | shift 24 | done 25 | 26 | if [ $CHANGED -eq 1 ]; then 27 | sudo cp $OUT /etc/default/docker 28 | sudo service docker restart 29 | fi 30 | rm -f $OUT 31 | --------------------------------------------------------------------------------