lib/connection.rb in forj-0.0.24 vs lib/connection.rb in forj-0.0.25
- old
+ new
@@ -13,10 +13,11 @@
# 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.
+require 'rubygems'
require 'fog'
require 'require_relative'
require_relative 'yaml_parse.rb'
include YamlParse
@@ -58,21 +59,21 @@
end
end
def get_credentials
home = File.expand_path('~')
- creds = format('%{home}/.hpcloud/accounts/hp', home: home)
+ creds = '%s/.hpcloud/accounts/hp' % [home]
template = YAML.load_file(creds)
credentials = Hash.new
begin
credentials['access_key'] = template[:credentials][:account_id]
credentials['secret_key'] = template[:credentials][:secret_key]
credentials['auth_uri'] = template[:credentials][:auth_uri]
credentials['tenant_id'] = template[:credentials][:tenant_id]
credentials['availability_zone'] = template[:regions][:compute]
rescue => e
- puts format('your credentials are not configured, delete the file %{creds} and run forj setup again', creds: creds)
+ puts 'your credentials are not configured, delete the file %s and run forj setup again' % [creds]
Logging.error(e.message)
end
credentials
end