From cac69844f639f7cf06d608e513ddbbc1ff7ad9d3 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Wed, 2 Oct 2013 16:38:20 +0400 Subject: [PATCH] added copyright headers --- fuelmenu/__init__.py | 13 +++++++++++++ fuelmenu/common/__init__.py | 13 +++++++++++++ fuelmenu/common/dialog.py | 13 +++++++++++++ fuelmenu/common/nailyfactersettings.py | 14 ++++++++++++++ fuelmenu/common/network.py | 14 ++++++++++++++ fuelmenu/common/puppet.py | 14 ++++++++++++++ fuelmenu/common/replace.py | 14 ++++++++++++++ fuelmenu/common/urwidwrapper.py | 14 ++++++++++++++ fuelmenu/fuelmenu.py | 14 ++++++++++++++ fuelmenu/modules/cobblerconf.py | 20 +++++++++++++++++--- fuelmenu/modules/dnsandhostname.py | 13 +++++++++++++ fuelmenu/modules/interfaces.py | 19 +++++++++++++++++-- fuelmenu/modules/mirrors.py | 13 +++++++++++++ fuelmenu/modules/rootpw.py | 13 +++++++++++++ fuelmenu/modules/saveandquit.py | 13 +++++++++++++ fuelmenu/modules/shell.py | 13 +++++++++++++ fuelmenu/modules/welcome.py | 13 +++++++++++++ fuelmenu/settings.py | 14 ++++++++++++++ 18 files changed, 249 insertions(+), 5 deletions(-) diff --git a/fuelmenu/__init__.py b/fuelmenu/__init__.py index e69de29..995782b 100644 --- a/fuelmenu/__init__.py +++ b/fuelmenu/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/fuelmenu/common/__init__.py b/fuelmenu/common/__init__.py index e69de29..995782b 100644 --- a/fuelmenu/common/__init__.py +++ b/fuelmenu/common/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/fuelmenu/common/dialog.py b/fuelmenu/common/dialog.py index ab022c6..1d54208 100644 --- a/fuelmenu/common/dialog.py +++ b/fuelmenu/common/dialog.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display diff --git a/fuelmenu/common/nailyfactersettings.py b/fuelmenu/common/nailyfactersettings.py index 13b0b3a..52225f2 100644 --- a/fuelmenu/common/nailyfactersettings.py +++ b/fuelmenu/common/nailyfactersettings.py @@ -1,3 +1,17 @@ +#!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import yaml import ConfigParser import collections diff --git a/fuelmenu/common/network.py b/fuelmenu/common/network.py index 0038e81..8bec4c3 100644 --- a/fuelmenu/common/network.py +++ b/fuelmenu/common/network.py @@ -1,3 +1,17 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import netaddr diff --git a/fuelmenu/common/puppet.py b/fuelmenu/common/puppet.py index 6a77800..442e743 100644 --- a/fuelmenu/common/puppet.py +++ b/fuelmenu/common/puppet.py @@ -1,3 +1,17 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import subprocess import sys import logging diff --git a/fuelmenu/common/replace.py b/fuelmenu/common/replace.py index 850769d..c2742df 100644 --- a/fuelmenu/common/replace.py +++ b/fuelmenu/common/replace.py @@ -1,3 +1,17 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import re diff --git a/fuelmenu/common/urwidwrapper.py b/fuelmenu/common/urwidwrapper.py index cfd6de0..9ae9f6c 100644 --- a/fuelmenu/common/urwidwrapper.py +++ b/fuelmenu/common/urwidwrapper.py @@ -1,3 +1,17 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import urwid import urwid.raw_display import urwid.web_display diff --git a/fuelmenu/fuelmenu.py b/fuelmenu/fuelmenu.py index 7b3de06..0c5c234 100755 --- a/fuelmenu/fuelmenu.py +++ b/fuelmenu/fuelmenu.py @@ -1,3 +1,17 @@ +#!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging import operator import os diff --git a/fuelmenu/modules/cobblerconf.py b/fuelmenu/modules/cobblerconf.py index 3ca9187..865f1ee 100644 --- a/fuelmenu/modules/cobblerconf.py +++ b/fuelmenu/modules/cobblerconf.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display @@ -10,7 +23,7 @@ import copy import socket import struct import netaddr -import dhcp_checker.api +import dhcp_checker.api, dhcp_checker.utils import netifaces import subprocess from fuelmenu.settings import * @@ -123,8 +136,9 @@ Please wait...") # '52:54:00:12:35:02', 'server_ip': '192.168.200.2', # 'dport': 67, 'message': 'offer', # 'gateway': '0.0.0.0'}] - dhcp_server_data = dhcp_checker.api.check_dhcp_on_eth( - self.activeiface, timeout=5) + with dhcp_checker.utils.IfaceState(self.activeiface) as iface: + dhcp_server_data = dhcp_checker.api.check_dhcp_on_eth( + iface, timeout=5) num_dhcp = len(dhcp_server_data) if num_dhcp == 0: diff --git a/fuelmenu/modules/dnsandhostname.py b/fuelmenu/modules/dnsandhostname.py index cb1b15b..1c5a955 100644 --- a/fuelmenu/modules/dnsandhostname.py +++ b/fuelmenu/modules/dnsandhostname.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display diff --git a/fuelmenu/modules/interfaces.py b/fuelmenu/modules/interfaces.py index 16da3ab..195579d 100644 --- a/fuelmenu/modules/interfaces.py +++ b/fuelmenu/modules/interfaces.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display @@ -12,6 +25,7 @@ import re import netaddr import netifaces import dhcp_checker.api +import dhcp_checker.utils from fuelmenu.settings import * from fuelmenu.common import network, puppet, replace, dialog from fuelmenu.common.urwidwrapper import * @@ -130,8 +144,9 @@ class interfaces(urwid.WidgetWrap): "Please wait...") self.parent.refreshScreen() try: - dhcp_server_data = dhcp_checker.api.check_dhcp_on_eth( - self.activeiface, timeout=3) + with dhcp_checker.utils.IfaceState(self.activeiface) as iface: + dhcp_server_data = dhcp_checker.api.check_dhcp_on_eth( + iface, timeout=5) if len(dhcp_server_data) < 1: self.log.debug("No DHCP servers found. Warning user about " "dhcp_nowait.") diff --git a/fuelmenu/modules/mirrors.py b/fuelmenu/modules/mirrors.py index bd76fe4..b77bb57 100644 --- a/fuelmenu/modules/mirrors.py +++ b/fuelmenu/modules/mirrors.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display diff --git a/fuelmenu/modules/rootpw.py b/fuelmenu/modules/rootpw.py index c716d53..b389f91 100644 --- a/fuelmenu/modules/rootpw.py +++ b/fuelmenu/modules/rootpw.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display diff --git a/fuelmenu/modules/saveandquit.py b/fuelmenu/modules/saveandquit.py index f899a71..0d7ab3e 100644 --- a/fuelmenu/modules/saveandquit.py +++ b/fuelmenu/modules/saveandquit.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display diff --git a/fuelmenu/modules/shell.py b/fuelmenu/modules/shell.py index 995e962..7f7fb47 100644 --- a/fuelmenu/modules/shell.py +++ b/fuelmenu/modules/shell.py @@ -1,4 +1,17 @@ #!/usr/bin/env python +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display diff --git a/fuelmenu/modules/welcome.py b/fuelmenu/modules/welcome.py index 65e2dfd..80d7f5a 100644 --- a/fuelmenu/modules/welcome.py +++ b/fuelmenu/modules/welcome.py @@ -1,5 +1,18 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import urwid import urwid.raw_display import urwid.web_display diff --git a/fuelmenu/settings.py b/fuelmenu/settings.py index c7bdc76..f7936b9 100644 --- a/fuelmenu/settings.py +++ b/fuelmenu/settings.py @@ -1,3 +1,17 @@ +# Copyright 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import yaml import collections try: