foreman_packages 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # ForemanPackages
2
2
 
3
+ #gem 'foreman_packages', '~> 1.0.1'
4
+
5
+ #其余版本均不能使用
3
6
  *Introdction here*
4
7
 
5
8
  ## Installation
@@ -41,7 +41,9 @@ class ForemanPackages::SypackagesController < ApplicationController
41
41
  # POST /sypackages.json
42
42
  def create
43
43
  @sypackage = ForemanPackages::Sypackage.new(params[:foreman_packages_sypackage])
44
- @sypackage.filename = params[:foreman_packages_sypackage][:filename].original_filename
44
+ if params[:foreman_packages_sypackage][:filename].present?
45
+ @sypackage.filename = params[:foreman_packages_sypackage][:filename].original_filename
46
+ end
45
47
  respond_to do |format|
46
48
  if @sypackage.save
47
49
  format.html { redirect_to @sypackage, notice: 'ForemanPackages::Sypackage was successfully created.' }
@@ -11,13 +11,19 @@ class ForemanPackages::Sypackage < ActiveRecord::Base
11
11
  #目前用 "/home/stdtnt/app/"代替 "/etc/puppet/environments/production/modules/packages"
12
12
  #该处需要注意权限问题,当前用户是否具有该目录的操作权限
13
13
  root_dir_name = "/etc/puppet/environments/production/modules/packages/"
14
+ /etc/puppet/environments/production/modules/packages
14
15
  #self.destory_dir #默认删除该目录,然后重新创建
15
16
  dir_exist_status = File.exist?(root_dir_name) #判断该目录是否存在
16
17
  if !dir_exist_status
17
18
  #创建目录结构
18
19
  Dir::mkdir(root_dir_name)
19
- Dir::mkdir(root_dir_name + "files")
20
- Dir::mkdir(root_dir_name + "manifests")
20
+ if !File.exist?(root_dir_name + "files")
21
+ Dir::mkdir(root_dir_name + "files")
22
+ end
23
+
24
+ if !File.exist?(root_dir_name + "manifests")
25
+ Dir::mkdir(root_dir_name + "manifests")
26
+ end
21
27
 
22
28
  #生成files下welcome.conf文件
23
29
  files_welcome_File = File.new(root_dir_name + "files/welcome.conf", "w+")
@@ -1,3 +1,3 @@
1
1
  module ForemanPackages
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_packages
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: